- These changes must be made on a per domain basis. Log into Plesk and enter the setup area for the domain that you would like to enable php5. Under ‘Services’ make sure that:
- PHP support is checked, safe_mode ‘on’ is unchecked
- CGI support is checked
- FastCGI support is checked
- SSH into your server as ‘root’ and execute these commands one at a time:
cp /opt/php51/cgi-bin/php5 /var/www/vhosts/<domain>/bin/ cd /var/www/vhosts/<domain>/ chown -R <domain-user>:psacln bin/ cd conf vim vhost.conf
Remember to replace <domain> with your actual domain name and <domain-user> with the ftp username for that domain. These commands: make a copy of the CGI version of php5 and place it in the ‘bin’ directory of the domain, change the owner of the ‘bin’ directory and the copy of php5 to the same as the domain user and create a vhost.conf file in the conf directory.
- Add these lines to the vhost.conf file that you are editing with ‘vim’:
AddHandler fcgid-script .php .php5 SuexecUserGroup <domain-user> psacln <Directory /var/www/vhosts/<domain>/httpdocs> FCGIWrapper /var/www/vhosts/<domain>/bin/php5 .php FCGIWrapper /var/www/vhosts/<domain>/bin/php5 .php5 Options ExecCGI +Indexes +FollowSymLinks allow from all </Directory>
Again please remember to make the correct substitutions for <domain> and <domain-user>.
- Execute this command to reconfigure your server to use the new vhost.conf file:
/usr/local/psa/admin/sbin/websrvmng -a -v
This will automatically restart your webserver.