PHP Developers Network

Change mysql/php version with script?
Page 1 of 1

Author:  josh [ Tue Aug 24, 2010 6:47 pm ]
Post subject:  Change mysql/php version with script?

Has anyone tried downloading all the different releases of the mysql source code and creating a .sh script to switch between them? Will it work well? I would imagine there would be issues with library linkage and compatibility? The issue I'm having is a client was running mysql 5.0.x and I was on 5.1.x - my tests pass on my server but not on his. Both my development machine and my continuous integration server where the tests run all use the latest. Do I have to purchase a server for every combination of software configuration I want my application to support? Or can it be emulated with virtual machines or something?

Same for PHP. I want to essentially have this happen:

) mysql 5.0.81 & php 5.3.1
) mysql 5.0.81 & php 5.3.2
) mysql 5.0.81 & php 5.3.3
) mysql 5.0.83 & php 5.3.1
) mysql 5.0.83 & php 5.3.2
) mysql 5.0.83 & php 5.3.3

Basically looping thru all combination, would I have to set up a virtual machine? Or would that even work?

==== Edit ====

Looks theoretically possible in wamp to switch versions using mouse clicks, but prefer a more automated open source linux oriented approach.

Author:  JakeJ [ Tue Aug 24, 2010 9:33 pm ]
Post subject:  Re: Change mysql/php version with script?

The problem with doing that with WAMP is that it's got to start and stop services.

In order to do what you want effectively, you would need to have the php service running for each version and probably apache as well, each on a different port.

From there, you write a script that runs your web pages from the different port numbers.

Author:  josh [ Wed Aug 25, 2010 12:31 am ]
Post subject:  Re: Change mysql/php version with script?

My tests run on the command line. My tests run without an Apache service at all. Lets just clarify that.

I guess on windows I can easily call one version of PHP vs the other on the command line. But what about mysql? I guess I should read up on starting windows services manually, and there is a way to change the port # in my.cnf?

Does it work the same or similar on linux? Will compiling different versions on the same machine be difficult (by that I mean will I have library conflicts and other ./configure errors?)

Author:  JakeJ [ Wed Aug 25, 2010 6:40 am ]
Post subject:  Re: Change mysql/php version with script?

Stopping and starting windows services on the command line is easy (net start "service name" or net stop "service name").

I don't know the answer to the other questions. It certainly sounds like an interesting experiment though.

Overall, I think virtualization might be easier and more importantly, less error prone because of the isolation.

Author:  josh [ Wed Aug 25, 2010 8:18 pm ]
Post subject:  Re: Change mysql/php version with script?

Author:  JakeJ [ Wed Aug 25, 2010 10:08 pm ]
Post subject:  Re: Change mysql/php version with script?

Not really anything specific. I guess it depends partly on the resources you have available.

If you're going to virtualize though, go with Linux as you can get a much smaller footprint than you can with an windows install. I believe you'll find several distros available primarily dedicated to a fine tuned LAMP set up. Go to if you didn't already know that.

If you have a machine available solely dedicated to this task, you can go with VM Ware Server which basically serves as the OS and runs your virtual machines.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group