免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2286 | 回复: 5
打印 上一主题 下一主题

[服务应用] centos6.5下如何开启nginx的debug级别 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-12-31 09:54 |只看该作者 |倒序浏览

centos下nginx 已安装配置好,当时没有配置error debug级别,现在php做的网页打开没有详细报错很头疼,请问如何修改nginx。conf 开启error debug级别产出error log 让网页打开有具体报错?

求职 : Linux运维
论坛徽章:
203
拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:57:092015小元宵徽章
日期:2015-03-06 15:58:182015年亚洲杯之约旦
日期:2015-04-05 20:08:292015年亚洲杯之澳大利亚
日期:2015-04-09 09:25:552015年亚洲杯之约旦
日期:2015-04-10 17:34:102015年亚洲杯之巴勒斯坦
日期:2015-04-10 17:35:342015年亚洲杯之日本
日期:2015-04-16 16:28:552015年亚洲杯纪念徽章
日期:2015-04-27 23:29:17操作系统版块每日发帖之星
日期:2015-06-06 22:20:00操作系统版块每日发帖之星
日期:2015-06-09 22:20:00
2 [报告]
发表于 2015-12-31 21:01 |只看该作者

tt

本帖最后由 lyhabc 于 2015-12-31 21:08 编辑

php-fpm.conf和php.ini和nginx.conf 都有配置debug级别的日志,打开它就可以啦


可以看到php和nginx的错误

2015/12/28 11:35:32 [emerg] 25290#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
executing too slow
PHP Warning:  scandir() has been disabled for security reasons in /data/l10n.php on line 814
[27-Dec-2015 23:35:10 UTC] PHP Warning:  scandir() has been disabled for security reasons in /data/l10n.php on line 814



3 error_log /usr/local/nginx/logs/nginx_error.log ;
4 pid /usr/local/nginx/logs/nginx.pid;


# tail nginx_error.log
2015/12/28 11:35:32 [emerg] 25290#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2015/12/28 11:35:32 [emerg] 25290#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2015/12/28 11:35:32 [emerg] 25290#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2015/12/28 11:35:32 [emerg] 25290#0: still could not bind()
2015/12/28 11:37:15 [emerg] 25429#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2015/12/28 11:37:15 [emerg] 25429#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2015/12/28 11:37:15 [emerg] 25429#0: still could not bind()




# tail error.log
2015/12/25 23:33:01 [notice] 6425#0: signal process started
2015/12/26 16:41:25 [notice] 26110#0: signal process started
2015/12/26 17:47:38 [notice] 29441#0: signal process started
2015/12/27 23:21:44 [notice] 18767#0: signal process started
2015/12/27 23:38:42 [notice] 19651#0: signal process started
2015/12/28 08:18:04 [notice] 14375#0: signal process started
[root@VM_9_115_centos logs]# tail nginx_error.log


[23-Dec-2015 09:59:48] NOTICE: finished trace of 12600
[23-Dec-2015 09:59:48] WARNING: [pool www.abc.cn] child 12590, script '/data/index.php' (request: "GET //index.php") executing too slow (1.203897 sec), logging
[23-Dec-2015 09:59:48] WARNING: [pool www.abc.cn] child 12573, script '/data/index.php' (request: "GET //index.php") executing too slow (1.100096 sec), logging
[23-Dec-2015 09:59:48] WARNING: [pool www.abc.cn] child 11975, script '/data/index.php' (request: "GET //index.php") executing too slow (1.068040 sec), logging



[22-Dec-2015 22:37:59] WARNING: [pool www.abc.cn] child 12590, script '/data/plugin-install.php' (request: "GET /data/plugin-install.php") executing too slow (1.110988 sec), logging
[22-Dec-2015 22:37:59] NOTICE: child 12590 stopped for tracing
[22-Dec-2015 22:37:59] NOTICE: about to trace 12590
[22-Dec-2015 22:37:59] NOTICE: finished trace of 12590
[22-Dec-2015 22:38:20] WARNING: [pool www.abc.cn] child 12593, script '/data/plugin-install.php' (request: "GET /data/plugin-install.php") executing too slow (1.302395


[19-Dec-2015 14:56:13] WARNING: [pool www.abc.cn] child 11333, script '/data/index.php' (request: "GET /data/index.php") executing too slow (1.218288 sec), logging
[19-Dec-2015 14:56:13] NOTICE: child 11333 stopped for tracing
[19-Dec-2015 14:56:13] NOTICE: about to trace 11333
[19-Dec-2015 14:56:13] ERROR: failed to ptrace(PEEKDATA) pid 11333: Input/output error (5)
[19-Dec-2015 14:56:13] NOTICE: finished trace of 11333


# tail /usr/local/php-fpm/var/log/phperror.log
[27-Dec-2015 23:35:04 UTC] PHP Warning:  scandir() has been disabled for security reasons in /data/l10n.php on line 814
[27-Dec-2015 23:35:10 UTC] PHP Warning:  scandir() has been disabled for security reasons in /data/l10n.php on line 814
[27-Dec-2015 23:35:10 UTC] PHP Warning:  scandir() has been disabled for security reasons in /data/l10n.php on line 814
[28-Dec-2015 03:54:51 UTC] PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
[28-Dec-2015 03:54:59 UTC] PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
[28-Dec-2015 03:55:03 UTC] PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0


php-fpm   2555  0.0  1.9 146972 36672 ?        S    Dec27   0:27 php-fpm: pool www.cc.cn                                                                                                               
php-fpm   3383  0.0  1.6 141556 31688 ?        S    Dec27   0:27 php-fpm: pool www.cc.cn                                                                                                               
php-fpm   4784  0.0  1.6 141476 31460 ?        S    Dec27   0:26 php-fpm: pool www.cc.cn                                                                                                               
php-fpm  17680  0.0  1.2 123360 23080 ?        S    09:07   0:13 php-fpm: pool www.cc.cn                                                                                                               
php-fpm  17681  0.0  0.4 109220  8964 ?        S    09:07   0:14 php-fpm: pool www.cc.cn                                                                                                               
php-fpm  17682  0.0  1.2 123360 23084 ?        S    09:07   0:13 php-fpm: pool



论坛徽章:
0
3 [报告]
发表于 2016-01-04 09:48 |只看该作者
回复 2# lyhabc


感谢感谢!!

论坛徽章:
0
4 [报告]
发表于 2016-01-04 09:51 |只看该作者
回复 2# lyhabc
能否加您的扣扣 跟您学做菜!

   

求职 : Linux运维
论坛徽章:
203
拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:57:092015小元宵徽章
日期:2015-03-06 15:58:182015年亚洲杯之约旦
日期:2015-04-05 20:08:292015年亚洲杯之澳大利亚
日期:2015-04-09 09:25:552015年亚洲杯之约旦
日期:2015-04-10 17:34:102015年亚洲杯之巴勒斯坦
日期:2015-04-10 17:35:342015年亚洲杯之日本
日期:2015-04-16 16:28:552015年亚洲杯纪念徽章
日期:2015-04-27 23:29:17操作系统版块每日发帖之星
日期:2015-06-06 22:20:00操作系统版块每日发帖之星
日期:2015-06-09 22:20:00
5 [报告]
发表于 2016-01-04 21:33 |只看该作者
学做菜???????

论坛徽章:
0
6 [报告]
发表于 2016-01-09 19:18 |只看该作者
回复 5# lyhabc
学linux!!!


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP