简体   繁体   English

xampp apache web服务器无法启动,退出代码8

[英]xampp apache web server not starting, exit code 8

My knowledge is very limited with these apache settings. 这些apache设置我的知识非常有限。 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... 启动Apache Web Server ...
Exit code: 8 退出代码:8
Stdout: 标准输出:
apache config test fails, aborting apache配置测试失败,中止
Stderr: 标准错误:
AH00526: Syntax error on line 237 of /Applications/XAMPP/xamppfiles/etc/httpd.conf: AH00526:/Applications/XAMPP/xamppfiles/etc/httpd.conf第237行的语法错误:
DocumentRoot must be a directory DocumentRoot必须是目录

It is a folder 这是一个文件夹

httpd.conf httpd.conf文件
line 线
237 DocumentRoot "/Users/username/Sites/xampp/site-folder” 237 DocumentRoot“/ Users / username / Sites / xampp / site-folder”
238 Directory "/Users/username/Sites/xampp/site-folder"> 238目录“/ 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” 好吧,因为逗号,你的文本编辑器在site-folder”之后从 to 变为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: 如果你在windows下运行xampp,你应该添加驱动器号,例如:

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.) (请注意,Windows使用\\(反斜杠)字符,但在apache配置文件中,引用目录时应始终使用/(斜杠)而不是\\。

xampp is Windows, isnt it? xampp是Windows,不是吗? lampp is for linux so I guess you want to use a Folder in your Users Home-Directory. lampp是针对linux的,所以我想你想在你的用户主目录中使用一个文件夹。 (UPDATE: whoops, lampp is the old name, but maybe this answer suits ur needs). (更新:whoops,lampp是旧名称,但也许这个答案适合你的需要)。

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. Windows目录分隔符是“\\”,您可以看到启动“资源管理器”并浏览目录。 "C:" is just the default partition where usually windows is installed. “C:”只是通常安装Windows的默认分区。 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. 如果您的安装位于其他位置(或者您将用户 - 目录路径更改为另一个驱动器/分区),只需将“C:”更改为您的目录所在的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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