In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
How to use php to output errors to a file, in view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Php will output the error to the file method: 1, find php.ini;2 in the php configuration file, by setting "log_errors = On" to input the error information into the log file.
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
How does php output errors to a file?
Input PHP errors into the log file
(LAMP) prevent client browsers from displaying PHP code errors and save error messages to log files:
Find php.ini in the php configuration file (such as in / etc/php.ini under Centos6.7), and set
Display_errors = Off / / error messages are not allowed to be displayed in browsers log_errors = On / / input error messages into log files error_log = / var/www/html/php_errors_log// specify error log location
Find the configuration file http.conf of apache (such as / etc/httpd/conf/httpd.conf under Centos6.7), and set
Php_flag display_errors off php_value error_reporting 2039
Restart the apache server
Service httpd restart
Note:
1. If the directory specified by log_errors exists or does not have permissions, the error will still be output to the browser
2. The Centos user who writes the error log to the log_errors file is apache (not an apache server, but a user of Centos), so pay attention to the permissions of the apache user.
This is the answer to the question about how to use php to output errors to files. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 301
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.