Error handling PHP

Source: Internet
Author: User

One HP Shutdown script error prompt method:

Open the php.ini file in the PHP installation directory

Find display_errors = on modified to display_errors = off

Note: If you have copied the php.ini file to the Windows directory, you must also change display_errors = on in C:\windows/php.ini to display_errors = off

Two method to have the script error prompt output as a log file:

Open the php.ini file in the PHP installation directory

Find log_errors = off modified to log_errors = on

Find error_log = FileName modified to error_log= "D:\PHPerrlog\php_error.log" (the directory and filename here D:\PHPerrlog\php_error.log whatever you want)

Note: If you have copied the php.ini file to the Windows directory, you must also put the C:\windows/php.ini file.

In addition, the error log cannot be printed php_error.log at least user modification and write permissions.

Three PHP program open



<?php

//Disable error Reporting

error_reporting (0);

//Report run-time error

error_reporting (E_error | e_warning | E_parse);

//Report all Errors

error_reporting (e_all);

?




in php.ini the error level is recommended to be set to: Error_reporting =e_all | E_strict

also needs to be modified to this: error_reporting =e_all & ~e_notice

Ini_set (error_reporting (0));

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.