Installing and enabling PEAR Mail on 1&1 Plesk VPS

PHP PEAR was not installed on my 1&1 VPS (CentOS 7) at all, so the first step was to to install it: 

yum install php-pear

Next, install PEAR Mail and Net_SMTP packages:

pear install mail

pear install Net_SMTP

PEAR was installed to /usr/share/pear path which was automatically added (or maybe was there before...) to the default include_path in Plesk PHP settings.

Still, when PHP was trying to use PEAR Mail, following error was logged:

Warning: require_once(): open_basedir restriction in effect. File (/usr/share/pear/Mail.php) is not within the allowed path(s)...

As the error suggests, Mail.php package is found but PHP's open_basedir was blocking access to it. To resolve this I had to add /usr/share/pear path to open_basedir in PHP settings within Plesk:

The full open_basedir string now was: {WEBSPACEROOT}{/}{:}{TMP}{/}:/usr/share/pear

 

February 2017
1&1 VPS Web Server
Plesk Onyx 17
CentOS 7
PHP
PEAR Mail

Newsletter

Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait