Free Php Scripts, Articles and Resources
    home  Home   php  PHPscripts   articles  Articles   contact  Contact
Date: 11 March 2010
in

Total scripts: 203
Total downloads: 25493
Total articles: 11

Latest Scripts
Free Contact Us Script +...
Free PHP ODP Script

Top Downloaded Scripts
Captcha Security Images
dGallery

Best Rated Scripts
File Searcher
Transparent Watermark

CATEGORIES

PHP ARTICLES

<< All Php Articles



 
Installing PHP 4 and PHP 5 concurrently ...
 
     

Currently in PHP community there are many people that are still programming their code in PHP 4. PHP 5 is not yet completely adopted by the programmers (or hosting companies) in spite of having been around for quite some time now. This could be explained by many reasons, but one thing is sure,the fifth version of this great programming language is much better than all the previous ones, and sooner or later it will become ubiquitous. But what to do until then? Is it possible to have the 'best of both worlds'?

Is it possible to have the both versions of PHP installed on the same computer without conflicts, so one can maintain old PHP 4 projects, and develop new PHP 5 code? The answer is, yes.

Here's my solution:

Few days ago I tried to install both versions on a single computer running Windows XP. First (as always) I consulted our all-knowing friend Google.com. I found millions of links with all kinds of tutorials, suggestions and forum posts on how to do the similar thing to the one I wanted to do. But I could not find the solution that was totally acceptable to me. Most of the examples showed how to install PHP 4 and PHP 5 on a single computer, but on a different ports, one as a apache module on port 80, and the other one as CGI/FAST CGI on port 83 (for example). I did not liked that idea. It was complicated to put the port numbers in URLs.

Then there were solutions that were based on the idea that PHP 5 pages should have .php5 extension and the other pages (PHP 4 ones) would remain .php. This was better but not good enough…. So I searched again. And again. And then I got really angry, and decided to do this by myself, exactly the way I wanted it to be done.

Here are the things I wanted to accomplish:

  1. A single Apache 2 installation
  2. PHP 4 to work on localhost, port 80, running as a Apache module,
  3. PHP 5 to work on the same port (80), but only on the specific sub domains of the same localhost Apache instalation

No more, no less…

After 2 days of try / fail iterations, I managed to solve the problem. This tutorial will show you how to acheieve this on your computer. (That is if you are interested to do so).


PREPARATIONS:

First of all you must clean your computer from all the old Apache and PHP installations. Make a backup of the current /htdocs/ directory to save your current projects and completely uninstall the Apache and PHP installations. By this I mean a TOTAL clean-up. You must delete ALL the Apache and PHP DLLs and config files. If you do not do that you will end up pulling hair from your head, trust me on this one…

After this, make sure you reboot your computer, and create a new Apache 2 installation. I suggest you choose CUSTOM installation, and install it to the D:/Apache2/ directory.

 

...

 

Slobodan Pavkov

 

Read the rest of the article here: http://devzone.zend.com/article/ 633-Installing-PHP-4-and-PHP-5-concurrently-on-one-WinXP-computer -with-a-single-Apache-2-installation-both-on-the-same-good-old-port-80

 

 
<< All Php Articles