This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14380|Reply: 1

[Website O&M] After running X3.2, PHP log prompts: PHP Strict Standards

[Copy link]
Posted on 4/27/2016 11:01:37 AM | | |

Operating system: win2008 R2
PHP version: v5.4.32
MySQL version: 5.5.39 Enable wincache and memcache

The following logs are repeated every day at an irregular time:
----------------------------------------------------------------------

PHP Strict Standards:  Declaration of table_forum_post::update() should be compatible with discuz_table::update($val, $data, $unbuffered = false, $low_priority = false) in bbs\source\ class\class_core.php on line 113

PHP Strict Standards:  Declaration of table_forum_post::delete() should be compatible with discuz_table::delete($val, $unbuffered = false) in bbs\source\class\class_core.php on line 113

PHP Strict Standards:  Declaration of table_forum_post::insert() should be compatible with discuz_table::insert($data, $return_insert_id = false, $replace = false, $silent = false) in bbs\source\class\class_core.php on line 113

PHP Strict Standards:  Declaration of table_forum_post::fetch() should be compatible with discuz_table::fetch($id, $force_from_db = false) in bbs\source\class\class_core.php on line 113

PHP Strict Standards:  Declaration of table_forum_post::fetch_all() should be compatible with discuz_table::fetch_all($ids, $force_from_db = false) in bbs\source\class\class_core.php on line 113

PHP Strict Standards:  Declaration of table_forum_post::update_cache() should be compatible with discuz_table::update_cache($id, $data, $cache_ttl = NULL, $pre_cache_key = NULL) in bbs\ source\class\class_core.php on line 113

This is due to the PHP version 5.3. Requires that the inheritance class must be defined after the parent class. Otherwise there will be Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of .... error prompt. That is, the parent class must come first, and the inherited class must come later. The first sentence of bbs\source\class\class_core.php can be modified: error_reporting(E_ALL & ~(E_STRICT |). E_NOTICE)); Try



When running PHP software, if you encounter a similar error, "Strict Standards", it is not a bug, but PHP 5.3 is not very compatible with previous versions. Versions after 5.3 require a declaration before use.
Modification php.ini can solve the problem, but in fact, this exception is not displayed:

Original php.ini
error_reporting = E_ALL | E_STRICT

modified to
error_reporting = E_ALL & ~E_NOTICE





Previous:Fixed a bug in RSS output after Discuz X3.2 upgrade
Next:asp.net Get the parameters that are passed to the background of jquery datatables
Posted on 12/17/2016 9:46:32 AM |
The error_reporting() function specifies which error to report. This function sets the error reporting level for the current script. The function returns the old error reporting level.
The first thing to know is that the error_reporting() function is used to set the error level and return the current level. It has 14 error levels, as follows:

1 E_ERROR Fatal runtime error. The error cannot be recovered. The execution of the script is suspended
2 E_WARNING Non-fatal runtime errors. The execution of the script does not stop
4 E_PARSE Error in parsing at compile time. Parsing errors should only be generated by the analyzer
8 E_NOTICE Notifications for running hours.
16 E_CORE_ERROR Fatal error on PHP startup. This is like a E_ERROR in the PHP core
32 E_CORE_WARNING Non-fatal error on PHP startup. This is like a warning E_WARNING in the PHP core
64 E_COMPILE_ERROR Fatal compile-time error. It's like generating a E_ERROR by the Zend scripting engine
128 E_COMPILE_WARNING Non-fatal compile-time error with a E_WARNING warning generated by the Zend scripting engine
256 E_USER_ERROR fatal user-generated errors.
512 E_USER_WARNING Non-fatal user-generated warnings.
1024 E_USER_NOTICE User-generated notifications.
2048 E_STRICT Notification of Runtime.
4096 E_RECOVERABLE_ERROR Catch a fatal error.
8191 E_ALL all errors and warnings.


Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com