My server uses Ubuntu with PHP5 and NginX.
I have installed pear using sudo apt-get install php-pear
, and later uninstalled it using sudo pear uninstall pear
. Today I downloaded phpmailer using sudo apt-get install libphp-phpmailer
.
I wrote code to send email with phpmailer. It begins with:
require_once("class.phpmailer.php");
and I edit the php.ini
both in /etc/php5/cli
and in /etc/php5/fpm
to set:
include_path = ".:/usr/share/php/libphp-phpmailer"
It did work well if I execute this php program in command line, but if I visit this php page through my browser, it produce a HTML500 error, and I checked the error.log
file, which shows:
PHP message: PHP Fatal error: require_once():
Failed opening required 'class.phpmailer.php'
(include_path='.:/usr/share/php:/usr/share/pear') in ...
I wander how comes this path? I am sure I have edited the include_path
in both php.ini files. Is there another configuration file I missed? Where does the string ".:/usr/share/php:/usr/share/pear"
come from?