Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Running multiple web development environments on one machine



TLUG,

I hope this question is appropriate here. It combines enough of installation issues of PHP, MySQL, and Linux.

Please feel free to tell me to RTFM if you can direct me to exactly where in the FM I should R. This is one of those situations where I am so lost on some fundamentals that I am not even sure which questions to ask.

I am running Ubuntu Linux, version 6.06 (called "Dapper") at home where I run MySQL 4.1.15. As a web site developer, the sites I develop are hosted on various hosting services, each with a different version of MySQL. One is 3.2, one is 4.1, and another will soon be upgrading to 5.0. They also have slightly different versions of PHP, I think. They're all 4 something, but might have slightly different global variable settings. They are all using the same version of Apache.

What I would like to do is simultaneously run different versions of MySQL/PHP on my home system so that I can simulate as closely as possible the web hosting conditions for each site I develop.

Installation of MySQL/PHP on my home system was handled automatically when I installed Ubuntu. So the particulars of where it is and how it is handled are opaque to me.

What particularly confuses me, and the issue I most need explained in simple terms, is to do with how the database gets called from within a PHP script. I simply run a command that says:
mysql_pconnect('localhost', 'user', 'password')

This indicates to me that the command to access the database looks on localhost, and from there automatically resolves to the MySQL server. So if there were more than one MySQL version running, how would I specify which one to use? And then, if I were to make such specifications, then wouldn't those specifications themselves break the usage of the scripts on the web hosting service?

Ditto for PHP.

But, before I even get to that point, how can I install the different versions? The only way I know to do this is to use the Ubuntu package installer, Synaptic, which seems to assume that I am upgrading or downgrading and therefor replacing the version I have.

Then, after that how would I be able to specify for each web site I am developing which version to use? It would be nice to be able to bundle installations of PHP/MySQL and anything else under one directory, or in some conceptual way, so that in my home environment I could make my web sites adhere to the system that matches their web hosting service.

Thank you for any advice.

--
Dave M G



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links