| < Previous | Index | Next > |
1) So far we've got a working PHP 4 installation, but how do you get PHP 5 running? First double-click the Apache Service Monitor icon in your system tray.
2) Click Stop to stop Apache.

3) Open into Notepad the Apache httpd.conf file which lives in C:\Program Files\Apache Software Foundation\Apache2.2\conf.
4) Find the PHP lines you added previously and comment out PHP 4 and un-comment PHP 5 by changing the lines to:
# PHP4 #LoadModule php4_module "C:/php/php-4.4.7-Win32/php4apache2.dll" #PHPIniDir "C:/php/php-4.4.7-Win32" # PHP5 LoadModule php5_module "c:/php/php-5.2.3-Win32/php5apache2_2.dll" PHPIniDir "C:/php/php-5.2.3-Win32"
5) Save the httpd.conf file.
6) Double-click the Apache Service Monitor icon in your system tray and click Start:

7) Apache with PHP 5.2.3 is running. If you look at the status bar in the Apache Service Monitor it now says Apache/2.2.4 (Win32) PHP/5.2.3.
8) Open your web browser and go to http://www.sandbox.dev. You will see the PHP 5 version of the phpinfo() page:

9) Thanks to the way we've configured the site you can access the Apache log files (both the access log and the error log) in C:\www\sandbox.dev\www_logs.
10) If PHP errors you can also pick-up a site specific PHP error log in C:\www\sandbox.dev, which you can analyse for problems. For as many new sites as you add locally you'll get all of these benefits.
You now have a fully working development environment, with installations of both PHP 4.4.7 and 5.2.2 that you can switch between at will. Now would be a good time to configure both of the php.ini files the way you want them, adding in the extra modules you need. You could also install MySQL locally if you require it.
In the following two sections I'll show you how to add another web site (and domain), and also how to build two batch files that will let you switch between PHP 4 and PHP 5 with a single click (no httpd.conf editing required!)
| < Previous | Index | Next > |
|
Need help? Post in the WAMP Guide Forum! © Copyright 2007 - 2008 Richard Davey |