请选择 进入手机版 | 继续访问电脑版

godaddy 优惠码

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3025|回复: 2

PHP Strict Standards: Non-static method should not be called statically [复制链接]

Rank: 9Rank: 9Rank: 9

UID
2
阅读权限
200
积分
6819
金钱
16091
威望
80
登录
1744 天
发表于 2014-2-16 13:17:55 |显示全部楼层

无意间发现主机巴士论坛(使用discuz X2)网站根目录下出现一个超大的error_log文件,达到500多MB,遂下载下来一段,打开发现全是类似附录的错误日志。

遂通过百度和discuz.net查找错误原因,但多说答案都是修改php.ini来屏蔽错误信息这种治标不治本的方案。有的说是discuz X2代码不兼容PHP5.4,使用了PHP5.4不支持的以静态方式调用非静态函数,修改方案就是修改错误日志中的函数为静态函数(就是在对应函数的申明前加static),但是由于不熟悉代码,不清楚修改后会产生多大影响,不敢轻易动手。

既然有人说是discuz X2不支持PHP5.4,那么将php版本降级也许可以解决问题。于是将主机巴士论坛的PHP版本从php5.4降级为php5.2,之后果然日志没有,而且发现主机巴士论坛网页打开速度变得明显快了很多。原来真的是discuz X2对php5.4支持的不行。

所以,如果您遇到类似的问题,可以通过降级PHP版本到5.4以下版本试试。

主机巴士用的是bluehost主机,主机控制面板是cpanel,php版本在cpanel中很容易操作:登录cpanel,在software(软件)下点开PHP config,里面就是PHP版本的选择。

主机巴士推荐bluehost主机,购买教程参考:
bluehost购买教程:Bluehost教程-主机购买图文教程(老界面的教程,bluehost改版后仅界面变化,购买流程完全没有改变)。
bluehost后台演示:bluehost cpanel管理后台演示面板链接

如果您没有信用卡和paypal,推荐godaddy主机,支持支付宝付款(godaddy 优惠码)。

附录:
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::table() should not be called statically in /home7/hostdhne/public_html/source/function/function_core.php on line 720
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::_execute() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 902
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB:bject() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 1006
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::query() should not be called statically in /home7/hostdhne/public_html/source/function/function_core.php on line 720
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::checkquery() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 980
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::_do_query_safe() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 1023
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::_execute() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 981
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB:bject() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 1006
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::fetch() should not be called statically in /home7/hostdhne/public_html/source/function/function_core.php on line 721
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB::_execute() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 962
[16-Feb-2014 11:40:36 Etc/GMT-8] PHP Strict Standards:  Non-static method DB:bject() should not be called statically in /home7/hostdhne/public_html/source/class/class_core.php on line 1006

分享到:
Disclosure:We are a professional review site that receives compensation from the companies whose products we review. We test each product thoroughly and give high marks to only the very best. We are independently owned and the opinions expressed here are our own.

Rank: 4

UID
22308
阅读权限
30
积分
188
金钱
312
威望
0
登录
31 天
发表于 2014-2-22 01:19:40 |显示全部楼层
楼主辛苦了,鼓励一下











Rank: 2

UID
25763
阅读权限
20
积分
59
金钱
95
威望
0
登录
9 天
发表于 2014-6-10 11:44:37 |显示全部楼层
谢谢楼主啊,受益匪浅啊!











您需要登录后才可以回帖 登录 | 注册

阿里云代金券
close
host1plus优惠码
close
vultr
digitalocean

Archiver|手机版|主机巴士论坛

GMT+8, 2018-11-18 07:33 , Processed in 0.048372 second(s), 15 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部