Setting include path for a domain in Plesk

If you need to use PEAR library functions in your web applications. Sometimes you may need to set the path to pear files for your domain so that the PEAR library files/classes are accessible to your PHP scripts. While using Plesk Parallels control panel you can do this as given below:

Login to SSH as root.

You need to set the “open_basedir” variable to include the path to PEAR. For this you need to open “vhosts.conf” file in the folder “/var/www/vhosts/your_domain_name/conf/”. It should look like this:

<Directory /var/www/vhosts/your_domain_name/httpdocs>
php_admin_value open_basedir /var/www/vhosts/your_domain_name/httpdocs
                                      :/tmp:<path_to_PEAR_installation>
</Directory>
ServerAlias *.your_domain_name

Now open your Plesk control panel, go to – domain name >> Web Hosting Settings, and CLEAR the checkbox next to text saying “PHP ‘safe_mode’ on”.

Now on the SSH restart the Apache using the following command:

# /etc/init.d/apache2 restart

Now go to your browser and refresh. Your website should be able to access the PEAR classes.

Scroll to top