Change mysql/php version with script?

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Change mysql/php version with script?

Post by josh »

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.
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: Change mysql/php version with script?

Post by JakeJ »

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.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Change mysql/php version with script?

Post by josh »

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?)
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: Change mysql/php version with script?

Post by JakeJ »

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.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Change mysql/php version with script?

Post by josh »

JakeJ wrote:Overall, I think virtualization might be easier and more importantly, less error prone because of the isolation.
Do you have any good resources to point me at about that topic?
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: Change mysql/php version with script?

Post by JakeJ »

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 http://www.distrowatch.com 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.
Post Reply