How to view php error log under linux

王林
Release: 2023-03-04 16:36:01
Original
9700 people have browsed it

How to view the php error log under Linux: 1. Open the php.ini configuration file and enable the error log; 2. Restart the web server; 3. View the error log storage location; 4. Execute [tail -f 50 /var/php_errors.log] command to view the error log.

How to view php error log under linux

Specific method:

(Recommended tutorial:php graphic tutorial)

1. Editing the configuration file

requires the following modifications to the configuration instructions in php.ini:

error_reporting = E_ALL; 将会向PHP报告发生的每个错误 display_errors = Off; 不显示满足上条 指令所定义规则的所有错误报告 log_errors = On; 开启错误日志 log_errors_max_len = 1024; 设置每个日志项的最大长度 error_log = /var/php_errors.log; 指定产生的 错误报告写入的日志文件位置
Copy after login

Restart the web server after completion.

2. Check the storage address

1. Check the error log storage address through php.ini

echo '' | php 2>&1 |grep -i error_log
Copy after login

(Video tutorial recommendation:php video tutorial)

Or output phpinfo(); in a php file to check the error log storage location.

How to view php error log under linux

2. Check the log storage location

vi /etc/php.ini
Copy after login

3. Check the log

tail -f -50 /var/php_errors.log
Copy after login

The above is the detailed content of How to view php error log under linux. 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
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!