Configuration and viewing logs
1. Related configuration
You need to modify the configuration instructions in php.ini as follows:
1. error_reporting = E_ALL ; Every error that occurs will be reported to PHP
2. display_errors = Off ; All error reports that meet the rules defined in the previous directive will not be displayed
3. log_errors = On Enter the log file location
After the PHP configuration file is set as above, restart the web server. In this way, when executing any PHP script file, all error reports generated will not be displayed in the browser, but will be recorded in the error log /usr/local/error.log specified by you. In addition, not only can all errors that meet the rules defined by error_reporting be recorded,
but also the error_log() function in PHP can be used to send a user-defined error message.
2. Check the storage address
1. Check the error log storage address through php.ini
echo '<?php phpinfo(); ?>' | php 2>&1 |grep -i error_log
Or output phpinfo() in a php file; check the error log Storage location
2. View the log storage location
vi /etc/php.ini
3. View the log:
tail -f -50 /var/php_errors.log
Recommended:
php serverThe above is the detailed content of PHP gets server error log. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1
Easy-to-use and free code editor
