解决ECShop出现Strict Standards: Only variables should be passed by reference in问题

今天开始研究ECShop,在安装完成的时候发现首页顶部、左侧和底部出现:

Strict Standards: Only variables should be passed by reference in F:\wamp\www\ecshop\upload\includes\cls_template.php on line 418

的报错信息。

第一种解决方法是杀到cls_template.php文件中发现下面这段代码:

$tag_sel = array_shift(explode(' ', $tag));

忘记说了,我的PHP版本是5.4.19,PHP5.3以上默认只能传递具体的变量,而不能通过函数返回值传递,所以这段代码中的explode就得移出来重新赋值了:

$tagArr = explode(' ', $tag);
$tag_sel = array_shift($tagArr);

这样之后顶部的报错没掉了,左侧和底部的报错还需要去ecshop的后台点击清除缓存才能去除。

第二种解决方法就是去php.ini里面修改error_reporting,改成error_reporting=E_ALL & ~E_STRICT,这个意思是显示所有除了严格模式的错误。

改完了之后需要到 ecshop\upload\includes\init.php中,将第45行的:

@ini_set('display_errors',1);

改成

@ini_set('display_errors',0);

这样ecshop\upload\includes\cls_template.php中的代码可以不用改,而且程序可以正确运行,缓存记得去后台清除下。

时间: 2024-08-03 05:52:23

解决ECShop出现Strict Standards: Only variables should be passed by reference in问题的相关文章

ecshop提示Strict Standards: Only variables should be passed by reference in错误

ecshop提示Strict Standards: Only variables should be passed by reference in E:/Tools/ECShop_V2.7.3_UTF8_release1106/upload/includes/cls_template.php on line 418 这个错误,搜索问题原来是php版本的问题,我是用的php5.4版本的,解决办法如下:    只要418行把这一句拆成两句就没有问题了   代码如下 复制代码 $tag_sel = a

ECshop Strict Standards: Only variables should be passed by reference in解决办法

错误提示 Strict Standards: Only variables should be passed by reference in D:/wamp/ecshop/includes/cls_template.php on line 406 用软件打开406行是这句话$tag_sel = array_shift(explode(' ', $tag)); 解决方法 5.3以上版本的问题,应该也和配置有关 只要406行把这一句拆成两句就没有问题了  代码如下 复制代码 $tag_sel = a

Strict Standards: Only variables should be passed by reference in

php中使用内置的reset函数可以获取array的第一个元素的值.例如:  代码如下 复制代码 $arr = array('one', 'two', 'three'); echo reset($arr);   // 输出的结果为 one对于下述代码,如果php开启了"Strict Standards",将会看到"Strict Standards: Only variables should be passed by reference in"的提示.  代码如下

Ecshop提示Only variables should be passed by reference in错误

Ecshop是个坑爹货,为什么tiandi会说它是个坑爹货呢,请看一下下面的官方的运行环境推荐: 服务器端运行环境推荐 ·php版本5.0以上5.3以下的版本(推荐使用5.2系列版本) ·Mysql版本5.0及以上 ·空间安装zend ·空间支持文件锁功能 ·开启GD功能 ·Mysql函数支持mbstring.iconv.fsockopen 看见了吧,PHP5.3以下的版本,还推荐使用5.2的,尼妹的,现在哪个虚拟机还敢用5.3以下的版本?还在用5.3以下的版本?看看tiandi用的2两个主机,

ecshop提示Strict Standards: Non-static method cls_image::gd_version()

在使用ecshop时提示 ecshop提示Strict Standards: Non-static method cls_image::gd_version() should not be called statically in E:/wwwroot/weirenchou/includes/lib_base.php on line 346 这个错误,搜索问题原来是php版本的问题,我是用的php5.4版本的,解决办法如下: 找到346行吧 return cls_image::gd_versio

php5.5中ecshop提示Only variables should be passed by reference

php大家用的版本不断提高,Ecshop没有来得及修改那么及时. Ecshop安装出现 Only variables should be passed by reference 5.3以上版本的问题,应该也和配置有关 只要418行把这一句拆成两句就没有问题了  代码如下 复制代码  $tag_sel = array_shift(explode(' ', $tag)); 改成:  $tag_arr = explode(' ', $tag);  $tag_sel = array_shift($tag

iis7.0-求助,报错PHP Strict Standards

问题描述 求助,报错PHP Strict Standards 试了好多方法,没用,请问这个怎么解决,用的iis7+php5.3的,报错PHP Strict Standards: Non-static method FastJSON::convert() should not be called statically, 代码是:return FastJSON::convert($array); 就是这行出错 解决方案 http://blog.csdn.net/tgh1981/article/det

解决ecshop出现Can’t select MySQL database错误提示

错误提示   ECSHOP info: Can't select MySQL database(ram),请问如何解决 ecshop 出现 Can't select MySQL database错误提示,整个网页就出现怎么几行大大的提示,之后便是一片的空白,其实像这种问题但凡只要懂点 PHP 的人都知道这是 mysql 数据库连接错误,不仅仅是在 ecshop 系统中,在其它 CMS 或者自己写的 PHP 中是一样的道理,既然知道了原因,哪我们就来检查一下 ecshop 的配置文件是否正确吧.

解决ecshop和jquery冲突 自定义美化商品属性选择

方法如下: 拷贝一个transport.js  为 transport1.js 在需要用到的页面插入这个新js 隐藏 586行处开始:/* Object.prototype.toJSONString = function () { var a = ['{'], // The array holding the text fragments. b, // A boolean indicating that a comma is required. k, // The current key. v;