4
votes

When i send mail using SMTP i am getting error like

PHP Fatal error: require_once(): Failed opening required 'Mail.php' (include_path='.:/usr/share/pear:/usr/share/php') in ...

How can i debug this? I have installed PEAR module correctly. Installed pear list is

Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.11  stable
Console_Getopt   1.3.1   stable
HTML_Common      1.2.5   stable
HTML_Page2       0.6.3   beta
Mail             1.2.0   stable
PEAR             1.9.4   stable
Structures_Graph 1.0.4   stable
XML_Util         1.2.1   stable

Need to install any other pear dependences?

Thanks in advance

2
You need to find Mail.php (pear list-files Mail) on your system and identify why it is not I your include path. Be aware your include path may be different between cli and web.AD7six
Hi..thanks for the reply.when i try this (pear list-files Mail) php /home/ec2-user/pear/share/pear/Mail.php and include_path is .:/usr/share/pear:/usr/share/phpRajaraman
need to change include path ?Rajaraman
Certainly looks that way, yes.AD7six
hi.. i had set include path like this set_include_path('.:/home/ec2-user/pear/share/pear:/home/ec2-user/pear/share/pear'); in top of the php page, But i am getting the same fatal error only.Rajaraman

2 Answers

1
votes

Ignore the Pear message.

You need to find the correct path to Mail.php.

If it is in the same folder then it will look like this:

require_once('Mail.php')

If not, then use absolute path. EG:

require_once('/var/www/Mail.php')

Or whatever the relative path is:

require_once('directory/Mail.php')
1
votes

Use terminal to check where Pear is installing .php files. Use command pear config-get php_dir to get the right directory. Use the Pear Manual to verify you Pear configuration and for debug.