FreeBSD Server Administration

« Happy Chinese New Year | Main

March 08, 2008

Upgrade to PHP 5 and MySQL 5

There is really no any reason to continue using PHP 4 and MySQL 4 except being lazy. The upgrade was quite smooth and took about 1.5 hours including compiling time.

Upgrade MySQL 4.0.27 to MySQL 5.0.51a
This guide explained it very well, just follow it.

Note:
1. mysql_upgrade will repair tables automatically when needed.

2. After running mysql_upgrade, mysql server should be restarted.

3. mysql_upgrade can be executed more than one time with the '-f' option. e.g. if you see lots of errors during mysql_upgrade, you may want to make sure all tables are OK.


Upgrading PHP 4.4.8 to 5.2.5
I started with this guide, but I didn't use portupgrade for such major upgrades. Anyway, it's basically the same, list all PHP related packages, delete them first, install them manually.

Note:
1. It seems that lang/php5-extensions has included all PHP related packages, just check those you required.

2. Apache configuration file needs some changes:
DirectoryIndex: I simply replaced 'php4' with 'php5'
AddType: Added the following lines:

<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>


Category : PHP

Posted by FreeBSD Newbie at March 8, 2008 01:53 PM

Comments

Post a comment



(Optional, will not be shown to the public)

Remember Me?