本地PHP环境PHP5.4,安装ecshop2.7.3后,很多地方会报如下的错

Redefining already defined constructor for class XXX

使用和类名相同点函数名作为构造函数是php4时代的写法,php5时代的构造函数是 __construct(),ecshop为了兼容老版本的php,所以采用了上面的写法。

但是从php5.4开始,对于这样的两种写法同时出现的情况,要求必须__construct()在前,同名函数在后,所以只需要对调两个函数的位置即可。

解决方案:打开ecshop目录下includes/cls_captcha.php,并执行下面操作。

把代码1 放到代码2后面就解决错误了

代码1:

 /**
* 构造函数
*
* @access public
* @param string $folder 背景图片所在目录
* @param integer $width 图片宽度
* @param integer $height 图片高度
* @return bool
*/
function captcha($folder = '', $width = 145, $height = 20)
{
if (!empty($folder))
{
$this->folder = $folder;
} $this->width = $width;
$this->height = $height; /* 检查是否支持 GD */
if (PHP_VERSION >= '4.3')
{ return (function_exists('imagecreatetruecolor') || function_exists('imagecreate'));
}
else
{ return (((imagetypes() & IMG_GIF) > 0) || ((imagetypes() & IMG_JPG)) > 0 );
}
}

代码2:

 /**
* 构造函数
*
* @access public
* @param
*
* @return void
*/
function __construct($folder = '', $width = 145, $height = 20)
{
$this->captcha($folder, $width, $height);
}

ECSHOP错误Redefining already defined constructor for class如何解决的更多相关文章

  1. Redefining already defined constructor

    报错:Strict standards: Redefining already defined constructor for class SplitWord in D:\wamp\www\wsc\i ...

  2. php高版本安装ecshop错误解决方法

    1.Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\ ...

  3. 错误:Implicit super constructor xx() is undefined for default constructor. Must define an explicit constructor

    错误:Implicit super constructor xx() is undefined for default constructor. Must define an explicit con ...

  4. ECSHOP 优化 ecshop错误转向地址更改

    原有的ECSHOP,在一些产品找不到或者被删除的情况下,亦或是直接对动态页面的访问,在参数丢失或者数据库找不到匹配数据时,程序处理是指向首页的,这样不利于优化,需对一些页面的程序进行修改,如:good ...

  5. Win7系统中提示:本地无法启动MySQL服务,报的错误:1067,进程意外终止的解决方法。

    Win7系统中提示:本地无法启动MySQL服务,报的错误:1067,进程意外终止的解决方法. 在本地计算机无法启动MYSQL服务错误1067进程意外终止.这种情况一般是my.ini文件配置出错了1.首 ...

  6. CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法

    CAS (10) -- JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法 jboss版本: jb ...

  7. 错误Name node is in safe mode的解决方法 (转)

    原文链接:错误Name node is in safe mode的解决方法 将本地文件拷贝到hdfs上去,结果上错误:Name node is in safe mode 这是因为在分布式文件系统启动的 ...

  8. Atitit.404错误解决标准流程and url汉字中文路径404错误resin4 resin chinese char path 404 err解决

    Atitit.404错误解决标准流程and 错误resin4 resin chinese char path 404 err解决 1. #原因解析 1 2. #解决方式 2 3. 输出图片流... 2 ...

  9. 关于错误Access Violation和too many consecutive exceptions 解决方法

    关于错误Access Violation和too many consecutive exceptions 解决方法 “如果DLL中用到了DELPHI的string类型,则DLL和主程序中都需要加上Sh ...

随机推荐

  1. HDU-1300(基础方程DP-遍历之前所有状态)

    Problem Description In Pearlania everybody is fond of pearls. One company, called The Royal Pearl, p ...

  2. Nginx+Tomcat的服务器端环境配置详解

    这篇文章主要介绍了Nginx+Tomcat的服务器端环境配置详解,包括Nginx与Tomcat的监控开启方法,需要的朋友可以参考下 Nginx+tomcat是目前主流的Javaweb架构,如何让ngi ...

  3. unique mapped reads

    就是指唯一比对的reads 现在人们已经开始避免使用unique mapped reads这个概念了,而转向使用mapq值来保留高质量的比对结果.因为mapq值反应了一组比对结果发生的可能性,MapQ ...

  4. centos 6.5上部署jetty

    和tomcat是一样的,在部署容器之前,我们首先得有java环境 这里我们选择用rpm包的方式安装jdk 这里我们上传我之前下载好的jdk包 然后按照该文章http://blog.csdn.net/x ...

  5. jQuery之DOM

    jQuery之DOM 1.jQuery属性. 获取元素属性的语法: attr(name)                   例子:$("#img1").attr("sr ...

  6. InstallShield 12 制作安装包

    目  录 一. 二. 三. (一) 打开project... 2 (二) project助手页面... 3 1.Application Information:程序信息... 4 2.Installa ...

  7. java继承分析

    把java学完之后有開始了一遍突然发现对于继承还是不太理解所以就做了一个測试来分析一下 <span style="font-size:18px;">class A{ p ...

  8. c++中返回对象与返回引用的区别

    这几天在做用C++做课程设计,对其返回对象的实现感到迷惑. 通过对汇编代码的分析,可以清楚的看到,直接返回引用和返回对象的区别到底是什么. 分析的程序如下 #include<cstdio> ...

  9. git 删除远程master 分支

    ➜  fekit-extension-yo git:(dev) git push origin :master remote: error: By default, deleting the curr ...

  10. PHP 5.6启动失败failed to open configuration file '/usr/local/php/etc/php-fpm.conf'

    PHP编译安装完毕,启动失败,提示 [-Jun- ::] ERROR: failed to open configuration ) [-Jun- ::] ERROR: failed to load ...