Home > Backend Development > PHP Tutorial > Why is the php page blank? What is the solution to the blank page in php?

Why is the php page blank? What is the solution to the blank page in php?

WBOY
Release: 2016-07-25 09:12:52
Original
4904 people have browsed it

When a php blank page appears, how to check the error message reported by php? Why is the php page blank? What is the solution to the blank page in php?

The specific method is as follows:

1. Set the error level of php by configuring the parameters in php.ini You can add a line to the appropriate location in php.ini error_reporting = e_all Note: There are some examples in php.ini. For example, the local php.ini has the following code

  1. ; examples:
  2. ; - show all errors, except for notices and coding standards warnings
  3. ;error_reporting = e_all & ~e_notice
  4. ; - show all errors, except for notices
  5. ;error_reporting = e_all & ~e_notice | e_strict
  6. ; - show only errors
  7. ;error_reporting = e_compile_error|e_recoverable_error|e_error|e_core_error
  8. ; - show all errors except for notices and coding standards warnings
  9. ;error_reporting = e_all & ~e_notice
Copy code

Just in Below these lines of code add: error_reporting = e_all Then restart the web service.

2. Set the php error reporting level through the php function error_reporting (applicable to virtual hosts) If you do not have permission to modify the parameter configuration in php.ini, you can use this function to set the error level. How to use the error_reporting() function error_reporting(report_level) If the parameter level is not specified, the current error level will be returned. Any number of the above options can be "or" connected (using or or |) to report all required error levels. For example, the following code turns off user-defined errors and warnings, performs some actions, and then returns to the original error level:

  1. //Disable error reporting
  2. error_reporting(0);
  3. //Report runtime errors
  4. error_reporting(e_error | e_warning | e_parse);
  5. //Report all errors
  6. error_reporting(e_all);
Copy the code

Then you can put in the include/common.inc.php file in the forum:

  1. error_reporting(0);
  2. Modify to:
  3. error_reporting(e_all);
Copy the code

and save it, so you can see the error message reported by php.

php displays blank page

1. In iis manager --> "web service extension" ---> add php extension

2. The error prompts of php are blocked. In this way, if an error occurs, you will not see the prompts and the page will be blank. It is recommended to set this in php.ini.

  1. phpinfo();
  2. ?>
Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template