我想启用重写日志来调试一些给我带来问题的重写规则。所以我在我的末尾添加了这些行httpd.conf file:
<IfModule mod_rewrite.c>
RewriteLog "/logs/rewrite.log"
RewriteLogLevel 4
</IfModule>
接下来我做的就是重新启动 Apache。但是,它会导致错误,并且不会启动。这是我在 XAMPP 控制面板中得到的结果:
13:14:56 [Apache] Error: Apache shutdown unexpectedly.
13:14:56 [Apache] This may be due to a blocked port, missing dependencies,
13:14:56 [Apache] improper privileges, a crash, or a shutdown by another method.
13:14:56 [Apache] Check the "/xampp/apache/logs/error.log" file
13:14:56 [Apache] and the Windows Event Viewer for more clues
我没有任何线索错误日志尽管。事实上,发生此错误时不会生成任何行。
我还尝试更改 RewriteLog 行以使用绝对路径:
RewriteLog "c:\xampp\apache\logs\rewrite.log"
请你帮助我好吗?
Apache 哪个版本?
在 2.4 中,RewriteLog* 指令不再存在,因为日志记录已被重写。在这种情况下,您应该附加mod_rewrite.c:trace3
给你的LogLevel
行,其中traceX 是详细级别(8 >= X >= 1)。输出将写入 Apache 标准错误日志 (ErrorLog
).
您还可以运行这些命令吗:httpd -t
(语法检查)然后httpd -w
(运行 Apache 但保持打开控制台,用作 stderr)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)