0

I'm trying to send mails using my local hosted PHP server,
I installed PEAR successfully using this guide and everything appears to be valid (path is familiar and reacts)
But when i try to run my PHP code which contains the use of Mail.php, i still get the following error :

Fatal error: require_once(): Failed opening required 'Mail.php' (include_path='.;C:\php\pear')

I wasn't even able to find where this path is defined (not in php.ini) in order to change it to the correct path and i didn't find it ..

SagiLow
  • 5,721
  • 9
  • 60
  • 115
  • The path `C:\php\pear` is automatically set by PHP on Windows. It's not that well documented, but this should be the reason. Set the include path to your concrete PEAR path and try again. – hakre Jul 17 '13 at 15:55

1 Answers1

0

. Make sure you have PEAR::Mail installed on your machine, if not then please install it.

If it is done.

Then please include your Mail.php in your script (probably before you instantiate Mail object. This should probably kick your warnings away.

include "/path/to/pear/Mail.php";

or

set_include_path("/path/to/pear");

Also specify path to Pear installation directory in php.ini include_path directive

But, if you this is still not solved your problem, then make sure there is enough permission given for Mail.php for PHP to read.

Engineer
  • 5,911
  • 4
  • 31
  • 58
  • Everything seems to be installed correctly... The path to PEAR folder is now correct and included in the `PHP.ini` , and still, i get an error : ` Failed opening required 'Mail.php' ......php\php5.4.12\pear` should the `include_path` point to PEAR folder ? – SagiLow Jul 17 '13 at 09:33
  • Yes.If you are using {include} then it should be complete path to the file like i gave in eg. Else the path to folder. (as in eg.) – Engineer Jul 17 '13 at 09:35