Drücke "Enter", um den Text zu überspringen.

php – hide/remove X-PHP-Originating-Script header

Hide/remove the X-PHP-Originating-Script header in php:

If you sent mail with you own php script all of the email are sent with this header:

X-PHP-Originating-Script: 1000:scriptname.php

Solution to remove this header:

Locate your php.ini

If you use the command line to execute the php script (via php -f filename.php) the location is:

nano /etc/php5/cli/php.ini

#Insert at the bottom! of the file:

mail.add_x_header = Off
expose_php = Off

You dont have to manually reload the ini file because at every php -f call it is done automatically.

If you visit a website to send the mail (call via webserver and not the command line) you must figure out via the phpinfo where you exact path is to the php.ini

Now the header does not stand anymore in the email.

1 Kommentar

  1. Greg Mai 11, 2018

    Or simply provide the two settings as commandline parameter:
    php -d mail.add_x_header=Off -d expose_php=Off …..

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.