Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
following the directions at markstechstuff.blogspot.com/2009/04/… worked for me, too. apparently, the Mail module of pear is not included in a standard Fedora install. Thanks jGc for the tip. –  Israel Kloss Feb 1 '12 at 14:15

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
Good to hear that you solved it :) –  rkthkr Jun 18 '09 at 11:24

Edit your php.ini and look for the paths and directories info. Add /usr/share/php/PEAR to *include_path=*, mine says:

include_path = ".:/usr/share/php:/usr/share/php/PEAR"
share|improve this answer
    
I tried it out. I set the include_path to ".:/usr/share/php:/usr/share/php/PEAR", but I still get the same error (the path changed). –  andi Jun 18 '09 at 9:47
    
Where is the Mail.php file located? –  rkthkr Jun 18 '09 at 10:17
    
/usr/share/php/Mail.php –  andi Jun 18 '09 at 10:26
    
I finally found out what was causing my error. Thanks for the answer anyway. –  andi Jun 18 '09 at 11:16

I had the same/similar problemo.

I resoved by via http://markstechstuff.blogspot.com/2009/04/installing-pear-mail-for-php-on-ubuntu.html

You may want to change the order of install however. mail seems to depend on the things listed below. My installation process was not smoothe.

But this resolve my Mail.php not being found.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.