[Consolidate the PHP Basics] php debugging methods for white pages during development, consolidate php

Source: Internet
Author: User
Tags php basics

[Consolidate the PHP Basics] php debugging methods for white pages during development, consolidate php
Overview of this article: 1. Set the error reporting level to display the error 2. possible causes of White Pages
1. [set error reporting level and Display Error Reporting]During php development, the access address is also correct, but the page is not displayed, and the page is displayed as a white page. Therefore, you can identify that an error occurs and you cannot view it through firebug, you need to go to index. set the error reporting mechanism at the php entry file. in ini, the priority is set to higher, because it is closer to the back. Define ('Environment ', 'dev'); For the development ENVIRONMENT, define ('Environment', 'production '); For the production ENVIRONMENT, all errors are prohibited, remember to change it after the development is complete

 2. [possible reasons for white pages]

In the future, if a white page is displayed, the error cannot be reported unless the display page is blank. Possible reasons:
A. No Display Error set in php. ini
B. Set error_reporting (0) in the page itself );
C. The @ symbol is used to suppress error prompting.
D. For a framework like CI, index. php In the system's entry file sets the production environment or development environment, and corresponding error reporting mechanisms are available for handling.
E. You can use firbug of Firefox to view errors. In "console" or "network", you can view "response" and "html". Here
In addition, when you want to develop ajax for interfaces such as json and xml, you can view the output content of the controller and model in these two fields.

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.