I recently required a development environment for WordPress-development, so I found xampp. I chose the portable variant.
After extracting it, I had a closer look at what the 'apache_start.bat' file does (after reading the enclosed readme file).
I did not like the prospect of having to place the package into the root directory, so I found out a more elegant way of getting the application server to start without having assume a certain file system location: by simply defining an environment
variable in the apache startup script, containing the current xampp installation directory and consuming this variable in all relevant configuration files:
----------------------
apache_start.bat:
' add (at the beginning):
SET XAMPP_ROOT=%~dp0
apache/conf/httpd.conf
apache/conf/extra/httpd-xampp.conf
apache/conf/extra/httpd-ssl.conf
php/php.ini
# replace each absolute path ('/xampp' or '\\xampp') with ${XAMPP_ROOT}
----------------------
There is probably a couple of additional locations I omitted - after changing the above-mentioned files I could successfully start-up apache and run PHP applications in it.
The benefit I see in this approach is that the application may be arbitrarily moved around in the file system without any manual configuration required afterwards. Also, arbitrary directories may be used.
How about adding this change into the product?
--
I tried the same for the mysql server. Unfortunately, mysqld does not seem to support evaluating environment variables. However, I think it should be possible to either pass all relevant configuration parameters via CLI - or it would also be thinkable to generate a configuration file on-the-fly
Cheers,
Christianh