Page 1 of 1

v 1.7.7: Custom docs directory for Apache, my solution

PostPosted: 17. March 2012 23:54
by alfps
XAMPP 1.7.7 in Windows 7, installed to [D:\bin\xampp].

Problem: some statuses showing as red and "deactivated" after changing the Apache documents directory.

* * *

After I got the XAMPP installation up and running (thanks for bundling all these things!) I wanted to change the Apache documents directory from [d:\bin\xampp\htdocs] to [d:\dev\websites].

This involved first changing the directory path two places in [D:\bin\xampp\apache\conf\httpd.conf].

For accessing the XAMPP status reporting etc. I created a subdirectory [d:\dev\websites\admin] containing a symbolic link called [d:\dev\websites\admin\xampp] pointing to the original [d:\bin\xampp\htdocs]. This should in theory allow me to browse to url [http://localhost/admin/xampp/] to access the XAMPP default page, and that worked. However, drilling down to [http://localhost/admin/xampp/status.php] now suddenly showed MySql, PHP and HTTPS as DEACTIVATED.

The cure I found was to fix a "bug" (?) in [D:\bin\xampp\htdocs\xampp\status.php], changing ...

Code: Select all
    $a = @file("$b/xampp/php.php");
    $php = $a[0];
    $a = @file("$b/xampp/mysql.php");
    $mysql = $a[0];
    $a = @file("$b/cgi-bin/cgi.cgi");
    $cgi = $a[0];
    $a = @file("$b/xampp/ssi.shtml");
    $ssi = $a[0];

to

Code: Select all
    $dir = dirname( $_SERVER["REQUEST_URI"] );

    $a = @file("$b/$dir/php.php");
    $php = $a[0];
    $a = @file("$b/$dir/mysql.php");
    $mysql = $a[0];
    $a = @file("$b/cgi-bin/cgi.cgi");
    $cgi = $a[0];
    $a = @file("$b/$dir/ssi.shtml");
    $ssi = $a[0];



This seems to work fine for the displayed statuses, at least MySql, PHP and HTTPS are now listed as ACTIVATED and nicely green.

Cheers & hth.,

- Alf

Re: v 1.7.7: Custom docs directory for Apache, my solution

PostPosted: 18. March 2012 02:56
by Sharley
alfps wrote:After I got the XAMPP installation up and running (thanks for bundling all these things!) I wanted to change the Apache documents directory from [d:\bin\xampp\htdocs] to [d:\dev\websites].

This involved first changing the directory path two places in [D:\bin\xampp\apache\conf\httpd.conf].
When you want to move the XAMPP installation, first make sure all components are stopped and all Windows services are uninstalled (no ticks in the Svc or Services boxes) and you have Quit the control panel or Exited depending on the version.

Then copy the xampp folder to it's new location and run the xampp_setup.exe file found in the xampp folder.

This will set all the required XAMPP system paths for you.

Test the new location.

If all is working fine then you can safely delete the other location's xampp folder.

The above process I use continually with absolute success each time as when all XAMPP's component Windows services are uninstalled there are no registry settings to worry about.

Good luck. :)