您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
安装ecshop首页报错Only variables should be passed by referen
从梦2024-12-26 11:00:52ecshop商城教程已有人查阅
导读出现下面这就话:Strict Standards: Only variables should be passed by reference in E:\Tools\ECShop_V2.7.3_UTF8_release1106\upload\includes\cls_template.php
on lin
出现下面这就话:
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
第418行:
5.3以上版本的问题,应该也和配置有关 只要418行把这一句拆成两句就没有问题了 $tag_sel = array_shift(explode(' ', $tag)); 改成: $tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
(实验过,绝对可行) 因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值
解决办法 2 : 或则如果这样配置的话:
Joomla其实是建议取消error的输出,如果出于调试需要,应改为
下面是错误输出配置的原文:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for. The recommended way of setting values for this
; directive is through the use of the error level constants and bitwise
; operators. The error level constants are below here for convenience as well as
; some common settings and their meanings.
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
; those related to E_NOTICE and E_STRICT, which together cover best practices and
; recommended coding standards in PHP. For performance reasons, this is the
; recommend error reporting setting. Your production server shouldn't be wasting
; resources complaining about best practices and coding standards. That's what
; development servers and development settings are for.
; Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This
; means it pretty much reports everything which is exactly what you want during
; development and early testing.
;
; Error Level Constants:
; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0)
; E_ERROR - fatal run-time errors
; E_RECOVERABLE_ERROR - almost fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
; E_DEPRECATED - warn about code that will not work in future versions
; of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE ------默认
; Development Value: E_ALL | E_STRICT ------开发用
; Production Value: E_ALL & ~E_DEPRECATED -- 正式发布用
;error_reporting = E_ALL | E_STRIC
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
第418行:
$tag_sel = array_shift(explode(' ', $tag));
解决办法 15.3以上版本的问题,应该也和配置有关 只要418行把这一句拆成两句就没有问题了 $tag_sel = array_shift(explode(' ', $tag)); 改成: $tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
(实验过,绝对可行) 因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值
解决办法 2 : 或则如果这样配置的话:
error_reporting = E_ALL | E_STRICT
php.ini中有如下设置:
error_reporting = E_ALL | E_STRICT
这是说,显示那些不符合编码规范的警告(coding standards warnings)。Joomla其实是建议取消error的输出,如果出于调试需要,应改为
error_reporting = E_ALL & ~E_NOTICE
问题得到解决。下面是错误输出配置的原文:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for. The recommended way of setting values for this
; directive is through the use of the error level constants and bitwise
; operators. The error level constants are below here for convenience as well as
; some common settings and their meanings.
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
; those related to E_NOTICE and E_STRICT, which together cover best practices and
; recommended coding standards in PHP. For performance reasons, this is the
; recommend error reporting setting. Your production server shouldn't be wasting
; resources complaining about best practices and coding standards. That's what
; development servers and development settings are for.
; Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This
; means it pretty much reports everything which is exactly what you want during
; development and early testing.
;
; Error Level Constants:
; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0)
; E_ERROR - fatal run-time errors
; E_RECOVERABLE_ERROR - almost fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
; E_DEPRECATED - warn about code that will not work in future versions
; of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE ------默认
; Development Value: E_ALL | E_STRICT ------开发用
; Production Value: E_ALL & ~E_DEPRECATED -- 正式发布用
;error_reporting = E_ALL | E_STRIC
本文标签:
很赞哦! ()
上一篇:ecshop标签调用大全
下一篇:ecshop模板修改方法教程
相关文章
随机图文
-
ecshop系统红包序列号规律怎么修改
ECSHOP系统线下发放红包时系统生成的红包序列号是在10000的基础上增加四位随机数字。如果当我们要发放大额度红包的时候,这样的序列号规则难免给人不安全的感觉,万一真的有哪个无聊的人 -
ecshop后台商品列表显示商品缩略图的方法
ecshop 后台商品列表显示商品缩略图,大楷步凑如下:一:admin\includes\lib_goods.php (可能是781行)二:admin\templates\goods_list.htm -
修改让在ecshop前台购物时无法选择“ ”的方法
我使用的是ECSHOP ,前台购物进入结算页面,无法选择“ ”?“ ”是跟你上一栏选择的“配送方式”相关的。 -
ecshop商城搬家迁移整站移动更换空间的说明
1、在后台执行数据库备份;2、把网站所有目录文件下载回本地备份(尤其注意模板和数据库备份文件);
留言与评论 (共有 条评论) |