简体   繁体   中英

xampp apache web server not starting, exit code 8

My knowledge is very limited with these apache settings. I wanted to have multiple sites that I could work on locally.

Yesterday it worked okay after installation but after shutting down and starting again today, it did not work.

Server won't start and Application log says:

Starting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
AH00526: Syntax error on line 237 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot must be a directory

It is a folder

httpd.conf
line
237 DocumentRoot "/Users/username/Sites/xampp/site-folder”
238 Directory "/Users/username/Sites/xampp/site-folder">

Any ideas what is wrong and what to do?

Thanks,

Well, It is because of the comma that your text editor changed from " to after site-folder”

237 DocumentRoot "/Users/username/Sites/xampp/site-folder” 
238 Directory "/Users/username/Sites/xampp/site-folder">

Change to:

237 DocumentRoot "/Users/username/Sites/xampp/site-folder"
238 Directory "/Users/username/Sites/xampp/site-folder">

if you are running xampp under windows, you should add the drive letter also eg:

DocumentRoot "C:/Users/username/Sites/xampp/site-folder”
<Directory "C:/Users/username/Sites/xampp/site-folder">

(note that windows uses the \\ (backslash) character, but in apache config files you should always use / (slash) instead of \\ when you reference directories.)

xampp is Windows, isnt it? lampp is for linux so I guess you want to use a Folder in your Users Home-Directory. (UPDATE: whoops, lampp is the old name, but maybe this answer suits ur needs).

Try

<Directory "C:\Users\username\Sites\xampp\site-folder">
</Directory>

Windows directory seperator is "\\" as you can see if you start your "Explorer" and navigate through directories. "C:" is just the default partition where usually windows is installed. If your installation is somewhere else (or if you changed your Users-Directory path to another drive/partition) just change "C:" to wherever your directory is on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM