我正在Windows 7上运行error_log("test")不会输出到我的vhostconfiguration中指定的error_log(尽pipe在同一configuration中指定的访问日志)。
有任何想法吗?
<VirtualHost *:80> DocumentRoot "c:\Users\User\Example" ServerName example.local CustomLog "C:\Users\User\Program\logs\local_access.log" combined ErrorLog "C:\Users\User\Program\logs\local_error.log" <Directory "C:\Users\User\Program"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
我不使用XAMPP很多,但快速查看包含的php.ini文件(php / php.ini)显示error_log (日志文件的path,而不是logging错误的函数)被设置为PHP /日志/ php_error.log)。
设置此值将覆盖默认的错误logging行为,并logging到指定的文件,而不是将错误发送到mod_php / Apache。
根据文件 :
error_logstring
应logging脚本错误的文件的名称。 该文件应该可以由Web服务器的用户写入。 如果使用特殊值syslog,那么错误将被发送到系统logging器。 在Unix上,这意味着系统日志(3),在Windows NT上它意味着事件日志。 系统logging器在Windows 95上不受支持。另请参阅:syslog()。 如果未设置此指令,则将错误发送到SAPI错误logging器。 例如,它是Apache中的错误日志或CLI中的stderr。