温馨提示  2024年 6月我们已经停止开发者板块文章内容更新,谢谢来访。存档数据
知识 2023-08-25 43 次阅读

如何解决strict standards php报错问题

   

strict standards php报错的解决方案 1. 在父类之后定义继承类; 2. 在“setup-config.php”文件中添加“error,reporting( ~(e,strict | e,notice));”。

本文操作环境windows7系统,php5.3.3版,dell g3电脑。

如何解决strict standards php报错问题?

php中strict standards错误解决方法

在php5.3.3 中安装wordpress 3.0.1 ,在安装时出现错误

strict standards: php strict standards: declaration of walker.....的解决方案

出现错误提示:

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 ........

错误原因

这是由于 php 5.3版本后。要求继承类必须在父类之后定义。否则就会出现strict standards: php strict standards: declaration of .... should be compatible with that of .... 的错误提示。这么说来必须父类在前,继承类在后。

错误参考页面。

bugs点php点net/bug.php?id=46851 (不能发表带链接的网址) 上面清楚地解释了出现此类错误的具体原因。

解决方案

在wordpress3.0.1 文件中,找到 wp-admin\\setup-config.php 文件。

在require,once('../wp-includes/compat.php'); 上面添加一句

error,reporting( ~(e,strict | e,notice));

问题解决。

这样的说法的意思是错误报告设置显示所有错误,但是除了严格错检查或者错误报告。这么说来php5.3.3 不执行严格错误检查。也不显示错误提示。跳过严格错误检查。

推荐学习《php视频教程》