发现php 运行错误时,浏览器的网页上并没有输出php的错误日志。那php的错误日志在哪里呢? 发现在 /var/log/nginx/error.log文件中。
怎么样才能在浏览器的网页中输出php的出错信息呢?
编辑 /etc/php5/fpm/php.ini文件,将display_errors = On. (如果不改php.ini文件,只是在执行文件中 ini_set("display_errors", "on"))发现没效果,不知道为什么呢?奇怪!!
这样改了php.ini文件后,网页上就可以看到php的出错信息了,便于调试。
-------------------------------------------------------------------------------------------------
|
I gathered insights from a bunch of answers here and I present a comprehensive solution: So, if you setup nginx with php5-fpm and log a message using A problem can arise if you want to log a lot of data (say an array) using To get around this you can configure
Now your logs will be in |