How to enable php error log in lnmp environment

王林
Release: 2023-03-06 18:50:01
Original
3241 people have browsed it

How to enable the php error log in the lnmp environment: first open the php-fpm.conf configuration file; then add [php_admin_flag[log_errors] = on]; and finally restart php-fpm.

How to enable php error log in lnmp environment

Errors under LNMP need to be set in /usr/local/php/etc/php-fpm.conf, add catch_workers_output = yes, and the error message will be It will be recorded to the file set by error_log in php-fpm.conf.

(Recommended tutorial:php video tutorial)

or add

php_admin_value[error_log] = /usr/local/php/var/log/php-error.log php_admin_flag[log_errors] = on
Copy after login

to php-fpm.conf. Both of the above methods will work. Restart php. -fpm takes effect

Similarly, display_errors in php.ini also needs to be set in php-fpm.conf. Add php_flag[display_errors] = On to enable it.

Sometimes the error log file may not be created automatically, you can execute:

touch /usr/local/php/var/log/php-error.log && chown www:www /usr/local/php/var/log/php-error.log
Copy after login

Related recommendations:php training

The above is the detailed content of How to enable php error log in lnmp environment. 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!