Home  >  Article  >  Backend Development  >  How to solve strict standards php error reporting problem

How to solve strict standards php error reporting problem

藏色散人
藏色散人Original
2021-12-09 10:24:212115browse

strict standards Solutions to PHP errors: 1. Define the inherited class after the parent class; 2. Add "error_reporting(~(E_STRICT | E_NOTICE));" to the "setup-config.php" file.

How to solve strict standards php error reporting problem

The operating environment of this article: Windows 7 system, PHP version 5.3.3, Dell G3 computer.

How to solve the strict standards php error problem?

Solution to Strict Standards error in PHP

Installing wordpress 3.0.1 in PHP5.3.3, an error occurred during installation:

Strict Standards: PHP Strict Standards: Declaration of Walker.... Solution:

Error message:

Strict Standards: PHP Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with that of Walker::start_lvl() in E:\Webroot\wordpress\wp-includes\classes.php on line 1199 PHP Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with that of Walker::end_lvl() in E:\Webroot\wordpress\wp-includes\classes.php on line 1199 PHP Strict ........

Cause of error:

This is due to PHP version 5.3. It is required that inherited classes must be defined after the parent class. Otherwise, the error message Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of .... will appear. That is to say, the parent class must be first and the inherited class last.

Error reference page.

bugs click php click net/bug.php?id=46851 (You cannot publish URLs with links) The specific reasons for such errors are clearly explained above.

Solution:

In the wordpress3.0.1 file, find the wp-admin\setup-config.php file.

Add a sentence above require_once('../wp-includes/compat.php');:

error_reporting( ~(E_STRICT | E_NOTICE));

Problem solved.

This sentence means error reporting settings: display all errors, except strict error checking or error reporting. In other words, PHP5.3.3 does not implement strict error checking. No error message is displayed either. Skip strict error checking.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to solve strict standards php error reporting problem. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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