国内外VPS
主机测评与优惠

ECShop安装过程报错:Strict Standards: Non-static method cls_image::gd_version() should not be called statically in XXX

在安装ECShop V2.7.3版本时,安装程序会提示错误,错误信息:Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:phpstudyWWWshopinstallincludeslib_installer.php on line 31,出错位置代码如下:

  	function get_gd_version()  	{  	    include_once(ROOT_PATH . 'includes/cls_image.php');  	    return cls_image::gd_version();  	}

这个错误的原因是程序调用的cls_image类中的gd_version()不是static静态方法,无法通过::直接调用方法。

解决方法有两种:

一,创建cls_image类的对象后再调用相应方法,将上述代码改为如下形式:

  	function get_gd_version()  	{  	    include_once(ROOT_PATH . 'includes/cls_image.php');  	    $gv = new cls_image();  	    return $gv->gd_version();  	}

二,修改cls_image类中的gd_version()方法为静态方法,打开include/cls_image.php文件,将678行的function gd_version()改成static function gd_version()即可。

因为在ECShop中存在多处这种调用方法,为了避免反复报错修改,所以强烈推荐采用第二种方法

赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《ECShop安装过程报错:Strict Standards: Non-static method cls_image::gd_version() should not be called statically in XXX》
文章链接:https://www.liuzhanwu.com/3363.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

登录

找回密码

注册