How to read php error log

coldplay.xixi
Release: 2023-03-08 12:32:01
Original
2274 people have browsed it

看php错误日志的方法:开启PHP错误日志级别,代码为【ini_set("display_errors", On);ini_set("error_reporting", E_ALL);】。

How to read php error log

本教程操作环境:windows7系统、PHP5.6版,DELL G3电脑。

看php错误日志的方法:

1、通过命令查看服务器上一共开了多少的 php-cgi 进程:

ps -fe |grep "php-fpm"|grep "pool"|wc -l
Copy after login

2、查看FPM在你的机子上的平均内存占用:

ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
Copy after login

3、指令ps找出消耗内存的元凶

ps -A --sort -rss -o comm,pmem,pcpu |uniq -c |head -15
Copy after login

PHP错误日志

vim /usr/local/php-5.6.5/etc/php.ini
  
display_errors = On
  
error_log = "/data/phplog/error_log"
  
chmod a+w /data/phplog/error_log
Copy after login

开启PHP错误日志级别

ini_set("display_errors", On);
ini_set("error_reporting", E_ALL);
Copy after login

相关视频推荐:PHP视频教程

The above is the detailed content of How to read php error log. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!