3
votes

I've installed Pear via the cPanel installer, and installed the Mail package (which also automatically installed Net_Mail and Net_Socket packages). However from my PHP file wherein I send email I get the following error:

Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in /usr/local/lib/php/Mail/smtp.php on line 348

Warning: include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /usr/local/lib/php/Mail/smtp.php on line 348

Fatal error: Class 'Net_SMTP' not found in /usr/local/lib/php/Mail/smtp.php on line 349

Now I have checked the includes, the paths, and all of them check out fine and are in the appropriate locations and have appropriate permissions.

How do I resolve this error?

For reference here's the directory structure (omitting other folders):

php
|-Mail
| |-mail.php
| |-mock.php
| |-null.php
| |-RFC822.php
| |-sendmail.php
| |-smtp.php
| |-smtpmx.php
|-Net
| |-SMTP.php
| |-Socket.php
|- Mail.php
1
Could you print your folder scheme? Have you looked for /usr/local/lib/php/Mail/smtp.php? - Shoe
@Charlie please refer to my updated post... I approximated the folder structure using ASCII. - Jon Limjap
I don't know. This problem occurred to me multiple times and it was always about the path which was not correct. You are might looking at a specific project editing another. I don't know it could be everything... - Shoe
Which folder did you ascii-print? (full path needed) - cweiske

1 Answers

6
votes

If you have ssh access you can try:

pear install Net_SMTP