Reverting PHP5 for (dv) 3.0 after migrating to a (dv) 3.5
Overview
This article provides a general walkthrough on how to remove the upgrade to PHP5 on a (dv) 3.0 Dedicated-Virtual Server after you have migrated to a (dv) 3.5 Dedicated-Virtual Server.
Instructions
If you were running PHP via suexec
These changes must be made on a per domain basis. You will need to perform the actions below on all domains on which you originally installed PHP5.
- SSH into your server as 'root' and execute this command:
vi /var/www/vhosts/example.com/conf/vhost.conf
- Remove these lines from the vhost.conf file that you are editing with 'vi':
AddHandler fcgid-script .php5 SuexecUserGroup <domain-user> psacln <Directory /var/www/vhosts/example.com/httpdocs> FCGIWrapper /var/www/vhosts/example.com/bin/php5 .php5 Options ExecCGI allow from all </Directory> - Execute this command to reconfigure your server and restart the webserver:
/usr/local/psa/admin/sbin/websrvmng -a -v
If you were running PHP without suexec
These changes must be made on a per domain basis. You will need to do the below on all domains on which you originally install PHP5.
- SSH into your server as 'root' and execute these commands one at a time:
vi /var/www/vhosts/example.com/conf/vhost.conf - Remove these lines from the vhost.conf file that you are editing with 'vi':
AddHandler fcgid-script .php5 <Directory /var/www/vhosts/example.com/httpdocs> FCGIWrapper /opt/php51/cgi-bin]/php5 .php5 Options ExecCGI allow from all </Directory> - Execute this command to reconfigure your server and restart the webserver:
/usr/local/psa/admin/sbin/websrvmng -a -v
If you enabled PHP5 for SSL
This section assumes that you had completed one of the sections above and that you have "SSL support" and "Single directory for housing SSL and non-SSL content" enabled in Plesk for that domain:
- Make sure you are in the proper directory:
cd /var/www/vhosts/example.com/conf/ - Copy your new vhost.conf file into "vhost_ssl.conf"
cp vhost.conf vhost_ssl.conf - Re-run the reconfigure webserver command.
/usr/local/psa/admin/sbin/websrvmng -a -v
This will remove the old PHP5 so your server will use the standard 3.5 version of PHP5.
Sub-domains
In order to remove the old PHP5 on subdomains, you must edit the "vhost.conf" file in each subdomain's conf directory:
/var/www/vhosts/example.com/subdomains/sub.example.com/conf/
Complete the same steps as above, simply change the directory paths to:
/var/www/vhosts/example.com/subdomains/sub.example.com/httpdocs/
You will need to run the "reconfigure webserver" command listed above.