XAMPP configuration problems

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Re: XAMPP configuration problems

Postby Nobbie » 11. December 2014 11:21

CliffMitchell wrote:With OS X when I browse http://localhost it works and takes me to the XAMPP for Mac OS X home page as you would expect - good, everything still works!
When I run my test file http://localhost/shawcottage/test.php) the output is: Document_route=/Applications/XAMPP/xamppfiles/htodcs so nothing has changed. At this point I checked the XAMPP control panel (from where I restarted apache) and I can see that apache is running but in the Application log is an error message:


Beware - this may come frome the browsers cache!! This is always an issue if you change Apache but do not clear the Browser Cache.

CliffMitchell wrote:So, my immediate problem is that I cannot change the DocumentRoot setting in httpd.conf. What am I doing wrong?


In my mind you simply did a typo, but I neither see your httpd.conf nor your filesystem. I am pretty sure that you misspelled anything or used a wrong syntax in httpd.conf

P.S.: Just saw the follow ups, of course it was a typo!
Nobbie
 
Posts: 8759
Joined: 09. March 2008 13:04

Re: XAMPP configuration problems

Postby CliffMitchell » 11. December 2014 12:11

Thanks Nobbie. Yes, it was a typo but only in my postings to this forum, the actual httpd.conf did not contain these typos. Sorry for the confusion. In any case, as you can see from the code I posted, I have removed the one change I made and I still cannot restart apache even though httpd.conf is back to its vanilla state!
CliffMitchell
 
Posts: 14
Joined: 12. July 2014 20:25
Operating System: Ubuntu

Re: XAMPP configuration problems

Postby JJ_Tagy » 11. December 2014 19:45

The only thing I can think is that you had a typo in the original problem you posed and/or your editor is adding extra characters in your config file. I just installed the same version on my 10.10.1 VM to test. I created a folder in /Applications/XAMPP/xamppfiles/htdocs called 'test' with an index.php file inside with only this:
Code: Select all
<?php echo $_SERVER['DOCUMENT_ROOT']; ?>

I then stopped the server (made sure the bubble went red and status said 'Stopped', edited the conf file two lines with:
Code: Select all
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/test"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/test">

I then started the server (made sure the bubble went green and status said 'Running'. In Safari, I typed in http://localhost/ and this presented:
Code: Select all
/Applications/XAMPP/xamppfiles/htdocs/test
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64

Re: XAMPP configuration problems

Postby CliffMitchell » 11. December 2014 20:30

Thanks JJ_Tagy - I'm going to replicate exactly what you have done and see what happens. I'll get back with the results.
CliffMitchell
 
Posts: 14
Joined: 12. July 2014 20:25
Operating System: Ubuntu

Re: XAMPP configuration problems

Postby CliffMitchell » 11. December 2014 20:57

Oh crap! I did exactly what you did - a clean install of XAMPP onto OS X 10.10.1, created the test folder and test.php as you did, I stopped the server and then made the 2 changes to the conf file (using the XAMPP Configure), restarted the server and ... it didn't start!!!!

The log shows:

Code: Select all
Stopping Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped
Starting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
AH00526: Syntax error on line 229 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot must be a directory


Now this is familiar!
Just for the record I used xampp-osx-5.6.3-0-installer.dmg

I just repeated the entire process but using TextEdit to edit the conf file instead of the XAMPP control panel - same results: apache will not now start. It worked fine until I edited the conf file.
CliffMitchell
 
Posts: 14
Joined: 12. July 2014 20:25
Operating System: Ubuntu

Re: XAMPP configuration problems

Postby JJ_Tagy » 11. December 2014 21:50

I recommend downloading TextWrangler. It is free and very functional for things like this.

Now, don't change anything else and let's look at line 229. Copy/paste your entry here. Is the folder 'test' or 'Test'? And for clarification, test.php should be index.php for the default to be picked up.
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64

Re: XAMPP configuration problems

Postby CliffMitchell » 11. December 2014 21:53

Eureka, I found the problem!! It's all in the quotes! Here are the 2 lines in httpd.conf after I open it for editing but before I change anything (note the quotes carefully):

DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">

Here are the same lines after I entered a / at the end of the DocumentRoot string - notice that the closing quote has changed! I didn't change it, it just changed:

DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/“
<Directory "/Applications/XAMPP/xamppfiles/htdocs">

Saving this file will, of course, lead to an error because this it not a properly formated string. This is really hard to spot if you are not looking for it and I have no idea why it happens - something odd with character sets somewhere (I'm set up for GB English).

A big thanks to those of you who helped me out with this - without your guidance I would never have found the problem (I was on the verge of giving up).

Thank you all ;-)

Cliff
CliffMitchell
 
Posts: 14
Joined: 12. July 2014 20:25
Operating System: Ubuntu

Re: XAMPP configuration problems

Postby CliffMitchell » 11. December 2014 23:38

Thanks JJ_Tagy, I think our posts crossed and I suspect you were already on the right track. Thanks also for the TextWrangler suggestion - I'm downloading a copy now.
Thanks for your help.
Cliff
CliffMitchell
 
Posts: 14
Joined: 12. July 2014 20:25
Operating System: Ubuntu

Previous

Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 5 guests