I'm trying to set a variable in PHP.ini file under ubuntu 10.10. Namely the sendmail_path.

On my system there are 4 php.ini files:

  • php.ini at /etc/php5/cli/
  • php.ini-productions at /usr/share/php5/
  • php.ini-productions.cli at /usr/share/php5/
  • php.ini-productions-dist at /usr/share/php5/

No other php.ini files are physically in/on my ubuntu 10.10 system.

I've altered all these files with sendmail_path = /usr/sbin/ssmtp -t I'm testing ssmtp for other reason.

Starting phpinfo() under apache2 shows the variable sendmail_path still not getting the new value.

Copy from phpinfo() after restarting apache2:

Configuration File (php.ini) Path   /etc/php5/apache2 
Loaded Configuration File   (none) 
sendmail_path           /usr/sbin/sendmail -t -i    /usr/sbin/sendmail -t -i 

Some more outputs from a terminal window:

$ php --ini
Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      /etc/php5/cli/conf.d/gd.ini,

$ php -v
PHP 5.3.3-1ubuntu9.10 with Suhosin-Patch (cli) (built: Feb 11 2012 06:21:15) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

I'm in no way of solving this, and have tried to google for this behavior this weekend with no luck.

Regards to you if you can solve this, I guess I'm not the only one having this “issue”.

  • The output from Apache says it is searching in /etc/php5/apache2, so have you tried creating a /etc/php5/apache2/php.ini file with the settings you want? May 21, 2012 at 2:25

1 Answer 1


I'm answering myself this time.

Found a solution on this issue after say more googling and the page at:


Really made my day.

Altered my empty httpd.conf file with the following:

php_admin_value sendmail_path "/usr/sbin/ssmtp -t"

Restarted apache2. No errors and phpinfo() shows the following at mentioned variable:

sendmail_path /usr/sbin/ssmtp -t /usr/sbin/sendmail -t -i

Guess I can go of and testing more with ssmtp now.

And there are more about this at http://www.php.net

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .