PDA

View Full Version : PEAR Mail help



orion100783
10-30-2008, 07:40 PM
I just installed the Mail PEAR package from the cPanel menu and am now getting this error:

Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in...

Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in...

Where am I supposed to keep these PEAR files, and how do I call them out in the script?

Thanks,
Daniel

davis
01-07-2010, 01:15 PM
Hi Daniel,

From my experience with HostMonster, they throw the PEAR pkgs from the cPanel auto-installer into /home/yourusername/php

The problem is they don't add that path to the default PHP.ini they provide you with. A quick way around that is to over-ride the path setting in the PHP.ini with set_include_path();

To ensure other things don't break, just add it to the end with the following:

$path = '/home/yourusername/php';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);