PHP: PEAR Library and Plesk

I was having an issue with setting up PEAR Library with PHP on my Linux box that runs Plesk, so after some research and a little help from the support team at HostMySite.com I came up with the following.

To run PEAR you obviously have to have it installed, so once you have done that, you will need to create a vhost.conf file for the domain that you wish the library to work with on the Plesk box.  This should look something like the following, and should be put into <account root>/conf/vhost.conf

 

<Directory /var/www/vhosts/my_domain_name.com/httpdocs>
       php_admin_value open_basedir "none"
       php_admin_value include_path "/var/www/vhosts/my_domain_name.com/httpdocs:/usr/local/PEAR:/tmp:"
</Directory>

 

Once you’ve created the vhost.conf file you have to run the following command.  I use Putty, but any SSH/Telnet client should work great.  This tells Plesk to rebuild the configuration files which will update with changes in the vhost.conf.  

  • /usr/local/psa/admin/sbin/websrvmng -v -a

And finally restart apache;

  • service httpd restart

These steps should get you to the right place.  At least they do for me.