This article introduces, PHP open Error_log log method, have the need for friends, refer to it. In PHP programming, for some access to the PHP page without obvious error hints, you can use Error_log to make further judgments. But for a variety of reasons, some servers do not have PHP error_log enabled. Test or other needs, you can open the method as follows. To edit php.ini, set Log_errors to On: Log_errors = OnThen, restart Apache. If successfully turned on, you can track the corresponding error prompt: [Mon SEP 24 16:57:01 2012] [ERROR] [Client 218.5.80.210] PHP Warning:fsockopen () have been disabled for security reasons in/home/bccgi-bin/fsockopen.php on line 2 [Mon SEP 24 16:57:02 2012] [ERROR] [Client 218.5.80.210] PHP Warning:fsockopen () have been disabled for security reasons in/home/bccgi-bin/fsockopen.php on line 2 [Mon SEP 24 16:57:03 2012] [ERROR] [Client 218.5.80.210] PHP Warning:fsockopen () have been disabled for security reasons in/home/bccgi-bin/fsockopen.php on line 2 [Mon SEP 24 16:57:04 2012] [ERROR] [Client 218.5.80.210] PHP Warning:fsockopen () have been disabled for security reasons in/home/bccgi-bin/fsockopen.php on line Also, note that in a Windows environment, in addition to setting log_errors to on, you need to define the path and file name of the Error_log: Error_log = D:/temp/error.log(This directory needs to be granted the PHP identity user's Modify permissions, otherwise the log file cannot be generated) IIS does not have the concept of error_log, so it needs to be defined separately. Whether it is PHP programming, or system-based operations and so on, log files are very important, to develop the habit of collecting and analyzing logs, and sometimes to solve the problem to bring great help. |