| < Previous | Index | Next > |
It's sods law. You just finished going through this guide, have a perfectly working development environment, and then they go and release PHP 5.2.4 or similar :) Fear not, it isn't as hard as you may think to upgrade.
First of all you have to decide if you need to ugprade or not. As you cannot have two versions of PHP 4 or PHP 5 running in together under Windows XP as Apache modules.
1) Download the new version of PHP 5 and un-zip it into your C:\php folder. The new folder name will be something like php-5.2.4-Win32 depending on the version of PHP 5 just released.
2) Rename the php.ini-dist file to php.ini and configure the error log and extension dir as you did in Step 4, replacing the folder names for the new ones.
3) Edit your Windows Environment Path Variable. Follow Step 6 of the guide, but instead of adding the new version of PHP 5 onto the end of the line, find the previous version and edit it to reflect the new path. You must still reboot after doing this (sorry!)
4) Edit the Apache httpd.conf file so that PHP 5 points to the new path. This is covered in Step 9. Edit the PHP5 LoadModule and PHPIniDir lines to reflect the new path, then save httpd.conf.
If you are using the PHP 4/5 Switcher then you need to create a new httpd_php5.conf file (see Step 16)
5) Restart Apache.
If all went according to plan then your new version of PHP 5 will now be running. Because you have gone back to a default php.ini file you will need to copy over any modifications you might have made to your previous PHP 5 php.ini file (such as enabling modules, etc).
This process is a little more complex than for PHP 5 because you need to rely on the Apache Lounge web site releasing a new Apache2 Handler for the new version of PHP 4. Go to the Apache Lounge Downloads page and look at the php4apache2.dll-php4.4.x.zip entry under the Apache 2.2 win32 module binaries section.
If the module has been updated then it will cover the new version of PHP in the description below it: apache2handler for Apache 2.2.x and PHP 4.4.0-4.4.7.
You need it to have whatever version of PHP 4 you're upgrading to on the end of that line. If the module hasn't yet been updated then you cannot upgrade at this time.
Assuming there is a new release, download it, unzip and check the readme file. Sometimes you may also need to get a new Visual C++ redist.
1) Download the new version of PHP 4 and un-zip it into your C:\php folder. The new folder name will be something like php-4.4.8-Win32 depending on the version of PHP 4 just released.
2) Rename the php.ini-dist file to php.ini and configure the error log and extension dir as you did in Step 3, replacing the folder names for the new ones.
3) Edit your Windows Environment Path Variable. Follow Step 6 of the guide, but instead of adding the new version of PHP 4 onto the end of the line, find the previous version and edit it to reflect the new path. You must still reboot after doing this (sorry!)
4) Edit the Apache httpd.conf file so that PHP 4 points to the new path. This is covered in Step 9. Edit the PHP4 LoadModule and PHPIniDir lines to reflect the new path, then save httpd.conf.
If you are using the PHP 4/5 Switcher then you need to create a new httpd_php4.conf file (see Step 16)
5) Restart Apache.
Only 1 version of PHP 4 and one version of PHP 5 should exist in the Windows Path Environment Variable. The version that exists here is the one Apache will use, regardless of the httpd.conf settings!
Always use the php.ini file that comes with the new release of PHP. They may have added new flags that are essential to that release of PHP. Don't be tempted to just copy over your old php.ini and hope for the best. Instead go through and reflect the changes from one to the other.
Any extra modules (say from PECL or Pear) that you installed in the previous version will need installing again in the new version, but be aware that they may not work (some PECL modules are designed for specific PHP releases). But that's the benefit of your development environment - if something breaks, you can disable it easily.
Need help on a more 'interactive' level? Then why not use the WAMP Guide Forum. Post any questions or problems you may have. You don't even need to register to join. We'll help you as much as we can.
| < Previous | Index | Next > |
|
Need help? Post in the WAMP Guide Forum! © Copyright 2007 - 2008 Richard Davey |