问题描述
php.ini 包含以下参数:
php.ini contains following parameters:
track_errors=On
error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT
log_errors=On
error_log="C:xamppphplogsphp_error_log"
但此路径中缺少日志"文件夹.它甚至不是隐藏文件夹.在哪里可以找到 php 错误日志?
but "logs" folder is missing in this path. Its not even hidden folder. where to find php error logs?
OS:windows 8.1
php version 5.6.24
推荐答案
不知何故 PHP 不会创建日志".文件夹本身......这就是我们需要做的:
Somehow PHP won't create the "logs" folder by itself... and that's what we need to do:
创建了日志";文件夹位于正确的位置(例如,
C:xamppphplogs
).
使用 XAMPP 控制面板重新启动 Apache(停止和启动).
Restart Apache using XAMPP control panel (stop and start).
然后,当发生错误时,文件将正常生成,您将再次能够从 XAMPP 控制台打开 PHP 日志
Then when an error occurs the file will be generated fine and you'll be again able to open the PHP logs from XAMPP console
要测试它是否正常工作,您可以使用以下方法创建一个致命错误
To test that it's working you can create a fatal error by using
trigger_error("Some info",E_USER_ERROR);
这篇关于XAMPP中缺少php错误日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!