How I installed PHP5 in 5 minutes
Wow. I’m flabbergasted. The heading was no joke, I had PHP5 running peacefully along PHP4 within 5 minutes. I wonder why I didn’t at least give this a try before. Just to think of all the possibilities this opens up now. Like Exceptions and Interfaces. It makes my head spin. Yeah, call me a geek.
Going virtual
What I did was to install PHP5 as CGI, whereas PHP4 keeps running as an Apache module. This method makes use of the directive in the Apache configuration. It was quite easy in my case as I have already set up virtual hosts on my local machine in order to have correct document roots for all the sites that I want to run and test locally.
After downloading the latest PHP binary for windows, I extracted the archive into a folder and opened the Apache httpd.conf file.
My httpd.conf file already contains entries like the following (sorry for the messed-up code-display, still have to figure this out):
Listen 127.0.0.1:81
NameVirtualHost 127.0.0.1:81
< VirtualHost localhost:81>
DocumentRoot "path/to/my/site-folder"
< /VirtualHost>
This makes Apache listen on local port 81. When I enter “http://localhost:81″ in a browser, the corresponding site is called with the document root correctly set. All I had to do to make PHP5 run in that folder was to add the following to the directive:
ScriptAlias /cgi-bin/ "C:/Programme/PHP5/"
Action php5-script /cgi-bin/php-cgi.exe
AddHandler php5-script .php .html
Another thing I had to do was activate MySQL in php.ini, since that’s not automatically included in PHP5 for licensing reasons.
That’s it!
And your host?
Well, that was even easier. I’m hosting all my sites on Domainfactory (I can recommend them 100%), and they have an option in their admin panel that you can use to switch between several PHP versions. So this site is officially running on PHP5 now. Pimped, as they say.
Here are some resources with more info and instructions:
http://www.sitepoint.com/blogs/2004/03/24/running-php4-and-php5-in-parallel/
http://www.circle.ch/wiki/index.php?page=Installation%2FPHP5
You’re currently reading “How I installed PHP5 in 5 minutes”, an entry on Michael Krenz
- Published:
- 28.02.06 / 12pm
- Category:
- Uncategorized
- Tags:
- PHP, Web Development
- Post Navigation:
- « PHP5, I’m coming! Or am I?
SimpleTest translation started »
Comments are closed
Comments are currently closed on this entry.