PhpNotice: Useofundefinedconstant solution

Source: Internet
Author: User
Error prompt: phpNotice: Useofundefinedconstant. Analysis: these are PHP prompts rather than error reports. PHP can be directly used without declaring the variable in advance, but a prompt will be prompted for not declaring the variable. Generally, as a formal website, the system will turn off the prompt.

Error message:Php Notice: Use of undefined constant

Analysis:These are PHP prompts rather than errors. PHP itself can be directly used without declaring variables in advance, but there will be prompts for UN-declared variables. Generally, when a website is a formal website, it will turn off the prompt and even the error message.

Solution:Close the PHP prompt and search for php. ini:

Change error_reporting = E_ALL to error_reporting = E_ALL &~ E_NOTICE

You can add the following code to each file header:

Error_reporting (0); this code is a php fault tolerance statement, which can block errors and does not display error information on the page, but the error still exists, although this is not good, it can solve the problem.

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.