- Applies to: All (dv)
- Difficulty: Easy
- Time needed: 5 minutes
- Tools needed: sshSecure Shell or ssh is a network protocol that allows data to be exchanged over a secure channel between two computers.’); return false;” href=”javascript:void(0)”>ssh,
Pear comes installed on your (dv) Dedicated-Virtual Server, but to enable it on one of your domains you’ll have to change the default open_basedir variable.
To change the default of this variable you’ll need AccountCenter if you don’t already have it.
NOTE:
Text in this color is used as an example. Please be sure to replace this text with the proper information for your site or server.
Please be aware that the following changes in your vhost.conf file will take precedence over any settings you may have in your httpd.conf file.
Here’s how to enable pear on a domain:
1) PleskPlesk is a software package which allows a server administrator to set up new websites, e-mail accounts, and DNS entries through a web-based interface. The administrator can create client and site templates, which predetermine resource allocation parameters for the domains and/or clients.’); return false;” href=”javascript:void(0)”>Plesk machine as “root” and cd to the conf directory for the domain on which you want to enable pear. Something like this should work:
For (dv) Dedicated-Virtual Server v2.0 systems:
cd /home/httpd/vhosts/mt-example.com/conf/
For (dv) Dedicated-Virtual Server v3.x systems:
cd /var/www/vhosts/mt-example.com/conf/
2) Create a file called vhost.conf using the vi editor with the following contents:
NOTE:
If you wish to make PEAR available via https follow the instructions below, but create “vhost_ssl.conf” instead of “vhost.conf”. If you wish to enable this for subdomains you must create the appropriate vhost.conf files for all subdomains that you need and then reconfigure the main vhost.conf file.
vi vhost.conf
For (dv) Dedicated-Virtual Server v2.0 systems:
<Directory "/home/httpd/vhosts/mt-example.com/httpdocs"> php_admin_value open_basedir "/home/httpd/vhosts/mt-example.com/httpdocs:/usr/share/pear:/tmp" php_admin_value include_path ".:/usr/share/pear" </Directory>
For (dv) Dedicated-Virtual Server v3.x systems:
<Directory "/var/www/vhosts/mt-example.com/httpdocs"> php_admin_value open_basedir "/var/www/vhosts/mt-example.com/httpdocs:/usr/share/pear:/tmp" php_admin_value include_path ".:/usr/share/pear" </Directory>
TIP:
If you want to switch off safe_mode on a per domain basis you can add the following line:
php_admin_value safe_mode Off
NOTE:
If you are having open_basedir problems not related to the use of PEAR you should add the path of the directory you are trying to access after :/tmp like this:
For (dv) Dedicated-Virtual Server v2.0 systems:
php_admin_value open_basedir "/home/httpd/vhosts/mt-example.com/httpdocs:/usr/share/pear:/tmp:/path/to/new/directory/to/access/"
For (dv) Dedicated-Virtual Server v3.x systems:
php_admin_value open_basedir "/var/www/vhosts/mt-example.com/httpdocs:/usr/share/pear:/tmp:/path/to/new/directory/to/access/"
Or you can try turning off open_basedir completely like this:
php_admin_value open_basedir none
3) Reconfigure your webserver so it will look for your new vhost.conf file by doing this:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=mt-example.com
4) Finally you must restart Uncategorized. Bookmark the permalink.