Sunday, December 14, 2008

Upgrade PHP 4 to PHP 5 on Windows. Apache 2.0

As I started to do more and more php/mysql database coding, I decided to move from php 4.4.7 to php 5 in order to take full advantage of php classes for use with data acess layers. The first thing I needed to do was to upgrade my windows xp/apache 2.0 testing server to php 5, without destroying my entire configuration. Fortunately, it was pretty easy. Here's what I did:

1. I downloaded the php 5.0 windows installer (visit php.net for the latest version).

2. I then ran the installer, which made the appropriate updates to my apache httpd.conf file. Make sure you install php 5 in a DIFFERENT directory than your php4 installation. My php 4 installation was in C:\php. The installer defaults to C:\program files\php, but just to be safe, I used C:\program files\php5.

3. Once that was done, I went back into the apache httpd.conf and the commented out any areas where php4 was mentioned. You will see your old php directory being referenced so you will easily see where to comment it out.

4. I then rebooted the machine, and loaded up a test page with phpinfo(); and all was well.

I didn't have to touch the MySql installation, and I didn't uninstall the php4 installation.

The whole thing took about 15 minutes -- not including the reboot :) .



Copyright © 2008 David A. Wank.
I encourage you to send any questions to davidwATshorthillsdesign.com. (replace "AT" with "@")
For website development and personal computer instruction, please visit my website: Short Hills Design.

No comments: