您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程

安装ecshop首页报错Only variables should be passed by referen

从梦2024-12-26Ecshop商城教程已有人查阅

导读出现下面这就话: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行:
$tag_sel = array_shift(explode(' ', $tag));
解决办法 1
5.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

本文标签:

很赞哦! ()

相关源码

  • 帝国cms7.5模板生活常识美食女性时尚综合资讯门户源码本模板为帝国cms7.5生活资讯类网站设计,以天奇生活网为参考原型,涵盖生活常识、美食烹饪、女性时尚等多元化内容板块。采用响应式布局设计,适配各种终端设备,为访客提供优质的阅读体验。模板结构清晰合理,内容展示层次分明,符合生活类网站的用户需求。查看源码
  • (PC+WAP)pbootcms模板黑色门窗定制五金建材网站下载为门窗定制与五金建材企业设计的网站解决方案,采用PbootCMS开发,兼具专业展示与营销功能。黑色系设计突显工业质感,响应式布局确保在手机、平板等设备上的浏览体验。通过简单的内容替换,也可适用于建材贸易、家具定制等相关行业。查看源码
  • 自适应响应式绿色装修公司定制家居类pbootcms网站下载(自适应手机端)响应式全屋装修定制家居类网站pbootcms模板 绿色装修公司网站源码下载PbootCMS内核开发的网站模板,该模板适用于装修定制网站、装查看源码
  • (自适应)双语网络电子摄像头设备pbootcms网站模板下载核心功能定位:基于PbootCMS开发的双语摄像头企业官网模板,深度适配产品规格书展示、实时监控演示、解决方案呈现等业务场景,支持中英文内容一键切换。查看源码
  • (PC+WAP)茶叶茶艺茶道茶文化pbootcms模网站源码下载本模板基于PbootCMS系统开发,为茶叶企业、茶艺培训机构设计,特别适合展示茶产品、茶道文化等内容。采用响应式技术,确保在不同设备上都能呈现优雅的茶文化氛围。查看源码
  • pbootcms模板(自适应手机版)红色响应式单位机构类网站自适应响应式单位机构网站模板 | PbootCMS内核开发为机构组织设计的响应式网站模板,采用PbootCMS内核开发,支持一键替换行业内容,满足多元化场景需求。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐