|
Posted by Chung Leong on 06/01/06 00:06
Taariqq wrote:
> Sorry to intrude, Justin and all,
>
> I am looking to do the same on an Windows XP machine.
> I have PHP 4 and Apache 2.0.55 configured and running. Looking to
> install PHP 5, and be able to switch b/w them, to test different code.
>
> Sincerely,
> Tariq
For development purpose, it's probably easiest to run multiple
instances of Apache 2.
First, open C:\WINDOWS\system32\drivers\etc and add a couple aliases to
the loopback address, like so:
127.0.0.4 php4
127.0.0.5 php5
Now, when you type in http://php5/ the browsers goes to one address and
when you type in http://php4/ it goes to another.
Second, create two copies of httpd.conf, name them httpd.php4.conf and
httpd.php5.conf (or whatever you feel like). In each, look for the
Listen directive and change it from 80 to 127.0.0.4:80 and
127.0.0.5:80. Put in the appropriate directives for loading the PHP
modules. You will likely want to use the PHPIniDir directive to set
the locations of php.ini.
Third, if Apache 2 is set up as a service already, remove it. Open a
command prompt window, cd to the Apache 2 bin folder, and enter "apache
-k uninstall." Then add two separate Apache services with the
following:
apache -k install -f conf/httpd.php4.conf -n "Apache 2 (PHP 4)"
apache -k install -f conf/httpd.php5.conf -n "Apache 2 (PHP 5)"
When you open up Services under Administrative tools, you'll see the
new services. Activate them. If the Apache monitor is running, restart
it. Then you'll see the two services there as well.
Finally, go to a phpinfo page at each location and verify the version
and php.ini path.
Happy coding!
Navigation:
[Reply to this message]
|