我爱帮助网-手册QQ交流群

Nas交流与矿渣群(unraid 群晖 猫盘 蜗牛等):580680114         物联网/智能家居群:518812757             帮助教程:手册大全

软件使用与建站群:1057308983      虚拟化交流群:13448651

0

在PHP5.6.9 中使用Discuz 3.2 ,在运行时出现错误PHP Strict Standards: Declaration of table_forum_post

在PHP5.6.9 中使用Discuz 3.2 ,在运行时出现错误:

 PHP Strict Standards:  Declaration of table_forum_post::update() should be compatible with discuz_table::update($val, $data, $unbuffered = false, $low_priority = false) in D:\wwwroot\officecn\web\source\class\table\table_forum_post.php on line 881


解决办法:

出现错误提示:


[17-May-2017 15:37:19 Etc/GMT-8] PHP Strict Standards:  Declaration of table_forum_post::update() should be compatible with discuz_table::update($val, $data, $unbuffered = false, $low_priority = false) in D:\wwwroot\officecn\web\source\class\table\table_forum_post.php on line 881
[17-May-2017 15:37:19 Etc/GMT-8] PHP Strict Standards:  Declaration of table_forum_post::delete() should be compatible with discuz_table::delete($val, $unbuffered = false) in D:\wwwroot\officecn\web\source\class\table\table_forum_post.php on line 881
[17-May-2017 15:37:19 Etc/GMT-8] 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 D:\wwwroot\officecn\web\source\class\table\table_forum_post.php on line 881
[17-May-2017 15:37:19 Etc/GMT-8] PHP Strict Standards:  Declaration of table_forum_post::fetch() should be compatible with discuz_table::fetch($id, $force_from_db = false) in D:\wwwroot\officecn\web\source\class\table\table_forum_post.php on line 881
[17-May-2017 15:37:19 Etc/GMT-8] PHP Strict Standards:  Declaration of table_forum_post::fetch_all() should be compatible with discuz_table::fetch_all($ids, $force_from_db = false) in D:\wwwroot\officecn\web\source\class\table\table_forum_post.php on line 881
[17-May-2017 15:37:19 Etc/GMT-8] 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 D:\wwwroot\officecn\web\source\class\table\table_forum_post.php on line 881


错误原因:
这是由于 php 5.3版本后。有些强制要求。否则就会出现Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of .... 的错误提示。 


这是由于 php 5.3版本后。要求继承类必须在父类之后定义。否则就会出现Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of .... 的错误提示。也就是说必须父类在前,继承类在后。可以修改bbs\source\class\class_core.php的第一句为:error_reporting(E_ALL & ~(E_STRICT | E_NOTICE));试试


解决办法:在Discuz 文件中,找到相关php 文件。 

添加一句:
error_reporting(E_ALL & ~(E_STRICT | E_NOTICE));
问题解决。
这句话的意思是错误报告设置:显示所有错误,但是除了严格错检查或者错误报告。也就是说PHP5.3.3 不执行严格错误检查。也不显示错误提示。跳过严格错误检查。