0

I am trying to work out where on earth this PHP ini setting is being made (below script is the only output on the script).


ini_get()

echo ini_get('sendmail_path');
//  /usr/sbin/sendmail -t -i 

phpinfo()

Loaded Configuration File: /etc/php/7.0/apache2/php.ini

/etc/php/7.0/apache2/php.ini

sendmail_path = "sudo /usr/sbin/sendmail -t -i -X /var/log/mail.log"

.htaccess

php_value sendmail_path 'sendmail -t -i -X /var/log/mail.log'

So how on earth is this setting being set?? Is there a way to see where the setting is coming from?

MonkeyZeus
  • 20,375
  • 4
  • 36
  • 77
UKUser35
  • 163
  • 1
  • 11
  • Have you tried a recursive search for `sendmail_path` on your web server. – MonkeyZeus Sep 23 '16 at 13:54
  • change the setting, test and see which... – Nomistake Sep 23 '16 at 13:55
  • how would I do the recursive search? – UKUser35 Sep 23 '16 at 13:56
  • I think this could work but I'm no Linux expert: [**`find / "*" -type f -print0 | xargs -0 grep -l "send_mail"`**](http://www.cyberciti.biz/faq/howto-recursively-search-all-files-for-words/) – MonkeyZeus Sep 23 '16 at 13:59
  • Or check out http://stackoverflow.com/q/1987926/2191572 – MonkeyZeus Sep 23 '16 at 14:00
  • If you have full control of the web server then also check for `php_value sendmail_path` within a vhost entry – MonkeyZeus Sep 23 '16 at 14:03
  • This is all well and good but phpinfo reports where the ini file is! So I am confused – UKUser35 Sep 23 '16 at 14:04
  • `phpinfo()` does you ZERO good if your PHP code has `ini_set('sendmail_path', '/some/crazy/path');` buried in the code. This is why I suggested the recursive search because it will reveal any PHP files messing with the `sendmail_path`. Same thing goes for the potential vhost entry. – MonkeyZeus Sep 23 '16 at 14:05
  • What I'm saying is my code file is simply `` – UKUser35 Sep 23 '16 at 14:16
  • Whatever, don't perform a recursive search; good luck to you. – MonkeyZeus Sep 23 '16 at 14:22
  • _“This is all well and good but phpinfo reports where the ini file is! ”_ – so what? php.ini is only one of multiple ways to set/change configuration values. http://php.net/manual/en/configuration.changes.modes.php – CBroe Sep 23 '16 at 14:25

1 Answers1

0

The reason that this wasn't working was because of an error in my php.ini file and it reverted back to the default option. I found this in the apache error log and from there was able to fix it.

UKUser35
  • 163
  • 1
  • 11