Issue :

You may get this error while trying to send mails through your PHP application

Error Fatal error: Call to undefined method PEAR

Fix :

This can be fixed by reloading the pear mail modules.

Try this:

#cd /usr/src

1. wget http://download.pear.php.net/package/Mail-1.1.14.tgz
2. wget http://download.pear.php.net/package/Net_SMTP-1.2.10.tgz
3. wget http://download.pear.php.net/package/Net_Socket-1.0.8.tgz

Extract the above and copy the extracted files to /usr/local/lib/php/

#cd /usr/local/lib/php

1. mkdir Net
2. cd Net
3. cp /usr/src/Net_SMTP-1.2.10/SMTP.php .
4. cp /usr/src/Net_Socket-1.0.8/Socket.php .
5. cd ..
6. cp -avr /usr/src/Mail-1.1.14/Mail/ .
7. cp -avr /usr/src/Mail-1.1.14/Mail.php .


Shares
Contact Us On WhatsApp