The solution to the problem that the php error log does not take effect: first edit "/etc/php-fpm.d/www.conf"; then restart "php-fpm"; finally call "error_log()".
The operating environment of this article: Windows7 system, PHP7.1 version, DELL G3 computer
What should I do if the php error log does not take effect?
Remember a pitfall where PHP error_log output log does not take effect
At first I wanted to use error_log() to output logs in the project, and enable the following configuration in php.ini:
log_errors = On error_log = /mnt/hgfs/workspace/php-error.log
Then use error_log() to print the log in the project and find that php-error.log has no content
Use phpinfo() to view the configuration
Found that the configuration in php.ini did not take effect. Edit /etc/php-fpm.d/www.conf
Comment out these two lines and restart php-fpm. , check again that phpinfo
# has become the value we configured, call error_log() again, and find that it can be correctly output to the file, because php_admin_value will overwrite the value in php.ini value.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What to do if php error log does not take effect. For more information, please follow other related articles on the PHP Chinese website!