I want a test- and development-environment for web using Apache, PHP and MySQL. I need to be able to test a single web-application with multiple versions of PHP (5.2, 5.3, etc) and multiple versions of MySQL (5.0, 5.1, 5.5, etc). It shall be hosted on a FreeBSD server.
My idea is to compile each version into a directory structure and running them on separate portnumbers. For example:
opt/apache2.2-php5.2-mysql-5.0 (httpd on port 8801, mysql on port 8802) (directory contains each software, compiled and linked towards eachother) opt/apache2.2-php5.3-mysql-5.1 (httpd on port 8803, mysql on port 8804) (and so on)
Any thoughts or suggestions of the best way to setup this type of environment?
UPDATE (background information): The environment would be for education. I have x00 students who develop webapplications and they have a directory where they store all their code (HTML, CSS, PHP, SQL etc). I would like to give them an easy way to test their applications on various versions of PHP and MySQL. There is no need, at this stage, to have different versions of the Apache httpd-server.
UPDATE (can not use Ports for installing): I can not use ports for keeping the software updated. I might need to install a very specific version of, for example MySQL, to perform some detailed testing using this particular version. It seems like compiling from source would be the only alternative.