Keeping PHP 5.2 and PHP 5.5 in one machine
Posted by: apprayo (180.245.129.---)
Date: May 06, 2014 01:37PM

Hi all,

I'm using WAMP 2.1 since 2011. It's a great package. The feature I like most is the PHP version switcher.

Now the day comes when I have to test some of my web-based apps on PHP 5.5.x. But there's no compatible add on for PHP 5.5.x to be put on WAMP 2.1. So I have to upgrade the WAMP to 2.5. The new installation runs smoothly in these first hours. But I need to have PHP 5.2 on my localhost, as I still have old apps which are still used by my clients.

My solution so far is to keep the old installation. I just renamed the old installation folder to wamp_old, and renamed folder setting in all configuration files into wamp_old (from wamp). When I need to run the old package to access my old apps, here is what I do:
1. Shutdown and uninstall all services (apache and mysqld).
2. Turn off the WAMPSERVER (the old one).
3. Turn on the new WAMPSERVER.
4. Install the services (apache and mysqld).

I have tested these steps only for several times, and it seems there's no problem with these steps.
I don't mind if I have to do those steps to keep my old apps running.

Is there any better way to provide PHP 5.2, 5.3 (I also have this version in the old installation), and PHP 5.5 in one installation?

I'm using Win7 64bit, and installed WAMP 2.5 32bit.

Regards,
Albert

Options: ReplyQuote
Re: Keeping PHP 5.2 and PHP 5.5 in one machine
Posted by: RiggsFolly (---.as13285.net)
Date: May 06, 2014 01:45PM

I wrote a document describing how to do this and it is a STICKY post on the top of the English forum [forum.wampserver.com]


Its not so different from what you have tried.



Once you have the new install up and running all you need to do is copy what you want from the

/wamp_old/apache/???
/wamp_old/mysql/???
/wamp_old/php/???

folders to the new /wamp folder equivalents.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Keeping PHP 5.2 and PHP 5.5 in one machine
Posted by: apprayo (180.245.129.---)
Date: May 06, 2014 02:46PM

Yes, I have read that documentation.

I have tried that one before I sent the post here. But I cannot make the Apache2.2.17, php5.3.5, and php5.2.11 running.

I can activate the Apache2.2.17 and php5.3.5 (both of them are checked), but I cannot run the Apache service. The icon shown is the orange one (MySQL service is running, and Apache one is not). I checked the Apache error log and cannot find anything there.

Options: ReplyQuote
Re: Keeping PHP 5.2 and PHP 5.5 in one machine
Posted by: RiggsFolly (---.as13285.net)
Date: May 06, 2014 03:42PM

You are probably running into the compiler issue.

Apache and PHP must be compiled with the same version of the compiler. You are probably trying to run an Apache compiled with VC6 and a PHP5.3.5 compiled with another compiler version VC9 possibly.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Keeping PHP 5.2 and PHP 5.5 in one machine
Posted by: apprayo (112.215.36.---)
Date: May 07, 2014 04:24AM

Both pairs were running well in the old installation (Apache 2.2.17 - PHP 5.3.5 and Apache 2.2.17 - PHP 5.2.11). So I think they must be compiled with the same compiler (I think with VC6).

Do they need also to be compatible with compiler used to compile wampserver.exe?

Options: ReplyQuote
Re: Keeping PHP 5.2 and PHP 5.5 in one machine
Posted by: RiggsFolly (---.as13285.net)
Date: May 07, 2014 10:58AM

No wampserver.exe is not relivant in this situation.


Ok I always find this difficult to describe so bear with me here.


The problem when switching between versions of Apache and PHP is that you can only switch one at a time i.e. you can switch Apache and then when thats done you can switch PHP or visa versa.

Now if you have a compatible Apache-PHP pair and try to switch down to an old PHP compiled with a different compiler Apache wont start properly using the newly switched to PHP, and visa versa if you switch the Apache first to an old Apache it wont run with the newer PHP.


One solution is to step backward from where you are to where you want to be, using an intermediate version of Apache and/or PHP so you can get to your desired destination through one or more intermediate versions of both Apache and PHP. This can envolve more than one (unnecessary version of both Apache and PHP)
However it does work as I have done this myself.

Alternatively, you switch either Apache or PHP to an incompatible version, ignore the error in startup and then switch the other version of either Apache or PHP. This should work, and will keep all the WAMPServer config files in step.

The new 2.5 switching mechanism has some extra checks in the switching process and you may get a command window thrown at you saying it has cancelled the switch due to incompatibilities. In this case you will probably have to install an intermediate version of either Apache or PHP.
You may also get a crash message from wampmanager, which I ignore and just continue the process with my fingers crossed.

I hope this is of some assistance.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Keeping PHP 5.2 and PHP 5.5 in one machine
Posted by: apprayo (---.google.com)
Date: May 07, 2014 04:52PM

Thanks for giving me extra patience..

Yes, I understand very well that to switch Apache and PHP to get the working pair selected, I need to switch them one by one, and in the process I will get an unmatched pair first.

These are the steps I do:
1. Stop the services.
2. Switch the Apache first (to 2.2).
3. Switch the PHP (to 5.3 or 5.2). Meanwhile I can get crash messages, but I just ignore them.
4. Make sure the pair I select has checks beside their names. Because I found sometimes the Apache/PHP is not checked, so I need to re-select them.
5. Start the services, one by one, Apache and MySQL.

As there's no error logged in the Apache log files, I tried to start the wampapache service via Services tool. It's failed too. Then I went to Event Viewer to get more detailed error message. And I got this:

"The wampapache service terminated with service-specific error Incorrect function.."

I have read this thread: [forum.wampserver.com]
It makes me wonder if this is also my case, as the existing setting of the pair is working well on WAMP 2.1. I have also tried to deactivate the aliases (I didn't create additional aliases, all aliases I have are the default ones), but no good result.

Options: ReplyQuote


Sorry, only registered users may post in this forum.