August 19, 2009

PHP 5.2.x & MySQL 5.0.x Upgrade for Plesk 8/9

Plesk generally runs a version or sub-version behind in their available PHP builds for Plesk. To safely upgrade PHP and MySQL on a production Plesk 8 or 9 server, please follow these instructions.

Step 1) Install the Atomic Channel:

$ wget -q -O – http://www.atomicorp.com/installers/atomic.sh | sh

Step 2) Upgrade PHP and MySQL:

$ yum upgrade php mysql

Step 3) Replace the PHP 4 php.ini with PHP 5.2.x’s (if applicable):

$ cp /etc/php.ini /etc/php.ini~backup

$ mv /etc/php.ini.rpmnew /etc/php.ini

Step 4) Replace the php.conf with the PHP 5.2.x php.conf (if applicable):

$ cp /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf~backup

$ mv /etc/httpd/conf.d/php.conf.rpmnew /etc/httpd/conf.d/php.conf

Step 5) Restart the webserver:

$ /etc/init.d/httpd restart

Step 6) Restart MySQL:

$ /etc/init.d/mysqld restart

Step 7) Test and confirm your PHP and MySQL versions via a phpinfo file.

Note: Please make sure to re-apply any security, optimization or memory management configuration to /etc/php.ini post upgrade.