How do I get PEAR Mail working?

August 18, 2014 3.1k views


I’ve successfully install pear, pear-mail, NetSMTP, AuthSASL, and Mail_Mime. I’m also running ServerPilot.

I’m including Mail.php in my script but it generates a fatal error every time. I cannot seem to work out how to include PEAR in my PHP.ini to get it working in my scripts.

All help appreciated!

1 comment
  • Hi! Could you please include the actual error message? It will make it easier to help figure out what the problem is.

2 Answers

Hi, did you use the correct pear command for your version of PHP? On ServerPilot, there will be a different pear command for each PHP version:


If you’re running just pear, then you might have accidentally installed some other PHP which is unrelated to your websites.

Also, it’s similar for the PHP CLI and pecl in case you end up needing those, too:

In general, any PHP-related command will end in “5.X-sp” where “5.X” is the PHP version.

Have another answer? Share your knowledge.