Linux – PEAR Mail problem on Ubuntu

linuxPHPUbuntuweb-server

I'm having trouble using the Mail package from PEAR.
I have PHP Version 5.2.8 installed (php-fpm used toghether with nginx)

$ pear version
PEAR Version: 1.7.2
PHP Version: 5.2.8-1hardy~ppa1

$ pear list
Package          Version State
Mail             1.1.14  stable
...

$ pear config-get php_dir
/usr/share/php

$ ls /usr/share/php/Mail.php
/usr/share/php/Mail.php

phpinfo() says:

include_path .:/usr/share/php

Everything seems fine, but when I try to

require_once "Mail.php";

I get:

Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in /home.. on line 2
Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/share/php') in /home.. on line 2

Am I missing something?

Best Answer

Turns out it was a open_basedir issue, which had the path /usr/share/pear instead of /usr/share/php.
I got it when I tried to require_once "/usr/share/php/Mail.php" and got an open_basedir error.
Changing it in /etc/php5/fpm.conf solved my problem.

Related Topic