Reverting PHP5 for (dv) 3.0 after a migration
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 new (dv).
Requirements
- You must have SSH access set up for root or a sudo user.
End of Life Warning
This service has a pending End of Life. Please move to a current service as soon as possible. For more information, please see: (dv) Dedicated-Virtual 4.0: Migration Information.
READ ME FIRST
This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.
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 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.