安装时的问题:

1.Strict Standards: Non-static method cls_image::gd_version() should not be called statically in /usr/local/httpd2/htdocs/upload/install/includes/lib_installer.php on line 31

解决:找到install/includes/lib_installer.php中的第31行   return cls_image::gd_version();

然后在找到include/cls_image.php中的678行,发现gd_version()方法未声明静态static,所以会出错。

这时候只要:

1)将function gd_version()改成static function gd_version()即可(严重建议使用此方法!!!)。

2)或者将install/includes/lib_installer.php中的第31行return cls_image::gd_version();改成:

$p = new cls_image();

return $p->gd_version();

2.检测环境的时候提示:是否支持 JPEG是不支持的。

解决:查看发现有libjpeg.lib库,GD2库也有,都加载了,也都正常。查看ecshop源代码发现install/includes/lib_installer.php中第100行,JPEG写成了JPG,正确的应该是:

$jpeg_enabled = ($gd_info['JPEG Support']=== true) ? $_LANG['support'] : $_LANG['not_support'];

为何说Ecshop写错了,因为打印数组$gd_info的时候,里面的键名是:JPEG Support。而$gd_info数组里的值都是直接调用系统环境变量的。

3.默认时区问题:Warning:date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/httpd2/htdocs/upload/install/includes/lib_installer.php on line 223

解决:

方法1,修改PHP配置文件。如果你服务器的主要时区是亚洲上海,那么修改这里是比较妥当的,当然更稳妥的办法是通过.htaccess导入PHP设置。

打开PHP.INI大概在958找到; date.timezone =去掉前面的注释;号,然后改成date.timezone =Asia/Shanghai,保存配置文件,重启你的服务器。

方法2,在页头使用

ini_set('date.timezone','Asia/Shanghai');

方法3,修改\install\includes\lib_installer.php文件。在这个文件顶部<?php之内加上如下PHP代码 :

date_default_timezone_set ('Asia/Shanghai');

登录使用时问题

一,ECshop是基于PHP5.3以下版本开发的,由于PHP5.5版本已废除了e模式修饰符,因此如果你使用的是PHP5.5以上环境安装,可能会出现类似以下3种报错

PHP 5.5. 起, 传入 "\e" 修饰符的时候,会产生一个 E_DEPRECATED 错误; PHP 7.0. 起,会产生 E_WARNING 错误,同时 "\e" 也无法起效。

可以使用 preg_replace_callback() 代替。

1,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /usr/local/httpd2/htdocs/upload/includes/cls_template.php on line 288

解决方法已经在报错提示中,打开/usr/local/httpd2/htdocs/upload/includes/cls_template.php定位至300行,将原本

return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);

改为

return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);

2,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\php_act\11_ec\upload\includes\cls_template.php on line 555

定位到upload\includes\cls_template.php第555行,将

$val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);

改为

$val=preg_replace_callback("/\[([^\[\]]*)\]/is",function($r){return '.'.str_replace('$','\$',$r[1]);},$val);

3,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\php_act\11_ec\upload\includes\cls_template.php on line 1075

定位到 upload\includes\cls_template.php on line 1075,将

$pattern = '/.*?/se';

$replacement = "'{include file='.strtolower('\\1'). '}'";

$source = preg_replace($pattern, $replacement, $source);

改为一行

$source = preg_replace_callback('/.*?/s', function($r){return '{include file='.strtolower($r[]). '}';}, $source);

4,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\php_act\11_ec\upload\includes\cls_template.php on line 496

定位到upload\includes\cls_template.php on line 496

$out = "<?php \n" . '$k = ' . preg_replace("/(\'\\$[^,]+)/e" , "stripslashes(trim('\\1','\''));", var_export($t, true)) . ";\n";

改为

$out = "<?php \n" . '$k = ' . preg_replace_callback("/(\'\\$[^,]+)/" , function($r){return stripslashes(trim($r[],'\''));}, var_export($t, true)) . ";\n";

二,PHP5.3以上默认只能传递具体的变量,而不能通过函数返回值传递

1,Strict standards: Only variables should be passed by reference in /usr/local/httpd2/htdocs/upload/includes/cls_template.php on line 423

定位upload/includes/cls_template.php on line 423:

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

改为

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

$tag_sel = array_shift($tag_sel);

2,Strict standards: Only variables should be passed by reference in F:\php_act\11_ec\upload\includes\lib_main.php on line 1329

定位到upload\includes\lib_main.php on line 1329

$ext = end(explode('.', $tmp));

改为

$_end=explode('.', $tmp);

$ext = end($_end);

三,Strict standards: Redefining already defined constructor for class XXX

此报错是使用PHP5.4以上版本安装ecshop可能出现的,例如本人安装后登录管理后台显示不出验证码这个情况:

右键验证码处点击“复制图片网址”后打开,便能看到这个错误。

打开报错所在文件看到如下代码:

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 );

}

}

function __construct($folder = '', $width = 145, $height = 20)

{

$this->captcha($folder, $width, $height);

}

可以看到其中使用和类名相同点函数名作为构造函数是php4时代的写法,php5时代的构造函数是 __construct(),ecshop为了兼容老版本的php,所以采用了上面的写法,但是从php5.4开始,对于这样的两种写法同时出现的情况,要求必须__construct()在前,同名函数在后,所以只需要对调两个函数的位置即可。

四,mktime()问题

1,Strict standards: mktime(): You should be using the time() function instead in F:\php_act\11_ec\upload\admin\sms_url.php on line 31

定位到upload\admin\sms_url.php on line 31

$auth = mktime();

改为

$auth = time();

2, Strict standards: mktime(): You should be using the time() function instead in F:\php_act\11_ec\upload\admin\shop_config.php on line 32

定位到upload\admin\shop_config.php on line 32,修改同上

安装office2010提示要安装MSXML6&period;10&period;1129&period;0解决方法

系统win7 32位 安装office2010出现了错误,提示要安装MSXML6.10.1129.0解决方法 1.下载MSXML6.10.1129.0进行安装 2.若本机已安装过不管用: a.在运行里 ...

VS2008 SP1 安装卡在 VS90sp1-KB945140-X86-CHS的解决方法

VS2008 SP1 安装卡在 VS90sp1-KB945140-X86-CHS的解决方法 VS2008 SP1 安装卡在 VS90sp1-KB945140-X86-CHS的解决方法 方法一:(不推荐 ...

【转】chrome 67版本后无法拖拽离线安装CRX格式插件的解决方法

第一种:开启开发者模式即可 (推荐) chrome  的设置 -> 更多工具 -> 扩展程序,开启开发者模式即可! 第二种方法:修改参数 首先打开下面地址:chrome://flags/# ...

ubuntu安装vmplayer出现问题的解决方法

ubuntu安装vmplayer 出现问题的解决方法 1:ubuntu12.04安装vmware12出现cannot ope dev/vmmon及modprobe vmmon提示密钥无效的解决办法 笔 ...

Tomcat安装教程及常见错误解决方法

目录 Tomcat安装教程及常见错误解决方法 一.安装前准备 ·熟悉自己电脑的操作系统版本(32位or64位) ·保证电脑上已经装好JDK,并且已经设置好环境变量. 二.Tomcat安装教程(以Tom ...

php5&period;4下安装ECshop出现错误的解决办法

转:http://www.programmernote.com/?p=65 1.安装是会提示 Warning: date_default_timezone_get(): It is not safe ...

安装Mysql提示1045错误解决方法

MySQL安装提示一下错误 The security settings could not be applied to the database because the connection has ...

Windows Server 2008 R2安装WAMPSERVER无法启动的解决方法

其实根本不算什么解决方法,会者不难的事.Windows Server 2008 R2(也包括其他版本的Windows)默认状态下安装WAMPSERVER经常是无法顺利启动WAMPSERVER的,尤其是 ...

Linux搭建python环境中cx&lowbar;Oracle模块安装遇到的问题与解决方法

安装或使用cx_Oracle时,需要用到Oracel的链接库,如libclntsh.so.11.1,否则会有各种各样的错误信息. 安装Oracle Instant Client就可得到这个链接库,避免 ...

随机推荐

vtkQuadric创建二次曲面

在本实例中,我们将用到vtkQuadric.vtkSampleFunction.vtkContourFilter三个类,分别是二次曲面函数.函数曲面抽样和等高滤波. vtkQuadric负责二次曲面基 ...

Spring MVC重定向和转发及异常处理

SpringMVC核心技术---转发和重定向 当处理器对请求处理完毕后,向其他资源进行跳转时,有两种跳转方式:请求转发与重定向.而根据要跳转的资源类型,又可分为两类:跳转到页面与跳转到其他处理器.对于 ...

详解 ML2 Core Plugin(I) - 每天5分钟玩转 OpenStack(71)

我们在 Neutron Server 小节学习到 Core Plugin,其功能是维护数据库中 network, subnet 和 port 的状态,并负责调用相应的 agent 在 network ...

PHP守护进程

php也是可以直接进行守护进程的启动与终止的,相对于shell来说会简单很多,理解更方便,当然了php的守护进程要实现自动重启还是要依赖于shell的crontab日程表,每隔一段时间去执行一次脚本看 ...

从&OpenCurlyDoubleQuote;程序员转行卖烧饼”想到IT人创业

我的一个朋友最近总在跟我念叨着“我不想做开发了,整天累死累活写程序,也攒不下几个钱.我想辞职搞点啥!” 我问他:“你想搞点啥?”. 他说:“搞啥都比做开发强,做个网站赚广告费,接私活……实在不行我去卖 ...

&period;NET中开源CMS目录

提起开源cms,大家第一想到的是php的cms,因为php开源的最早,也最为用户和站长们认可,随着各大cms系统的功能的不断完善和各式各样的开源cms的出现,.net和java的高端的cms系统也逐渐 ...

面向新手的Webserver搭建(一)——IIS的搭建

非常多童鞋说自己是做移动开发的,想挂个简单的Web API,但是server又不会搭,这样一来測试就成了问题.看看网上的教程.发现略难懂,并且大多是一个转一个,没价值,所以干脆写几篇文章讲讲简单的We ...

HTML meta refresh 刷新与跳转&lpar;重定向&rpar;页面

可用于 ...

Reverse Words in a String leetcode

Given an input string, reverse the string word by word. For example,Given s = "the sky is blue& ...

Python把给定的列表转化成二叉树

在LeetCode上做题时,有很多二叉树相关题目的测试数据是用列表给出的,提交的时候有时会出现一些数据通不过,这就需要在本地调试,因此需要使用列表来构建二叉树,方便自己调试.LeetCode上二叉树结 ...

php cannot call constructor,安装ECshop普遍问题的解决方法相关推荐

  1. php thrift 报错,thrift安装遇到的问题以及解决方法(必看篇)

    1. 必须安装boost.最新的稳定版是1.48.0. 1.1.先下载:http://sourceforge.NET/projects/boost/files/boost/1.48.0/ 选择tar. ...

  2. Centos系统上安装php遇到的错误解决方法集锦

    Centos系统上安装php遇到的错误解决方法集锦 1.configure: error: xml2-config not found. Please check your libxml2 insta ...

  3. Tesorflow源代码安装方式以及错误的解决方法

    Tesorflow源代码安装方式以及错误的解决方法 参考文章: (1)Tesorflow源代码安装方式以及错误的解决方法 (2)https://www.cnblogs.com/greentomlee/ ...

  4. ThinkPad安装deepin操作系统报错解决方法

    ThinkPad安装deepin操作系统报错解决方法 参考文章: (1)ThinkPad安装deepin操作系统报错解决方法 (2)https://www.cnblogs.com/haihua85/p ...

  5. Office安装时报错1907的解决方法

    Office安装时报错1907的解决方法 参考文章: (1)Office安装时报错1907的解决方法 (2)https://www.cnblogs.com/Harry-FeiLong/p/115685 ...

  6. Jenkins安装maven integration plugin失败解决方法

    Jenkins安装maven integration plugin失败解决方法 参考文章: (1)Jenkins安装maven integration plugin失败解决方法 (2)https:// ...

  7. 记一次用pip安装docker-compose报错及解决方法

    记一次用pip安装docker-compose报错及解决方法 参考文章: (1)记一次用pip安装docker-compose报错及解决方法 (2)https://www.cnblogs.com/fe ...

  8. 64位win10系统无法安装.Net framework3.5的解决方法

    64位win10系统无法安装.Net framework3.5的解决方法 参考文章: (1)64位win10系统无法安装.Net framework3.5的解决方法 (2)https://www.cn ...

  9. win10系统打开更新服务器失败怎么回事,Win10系统一直无法安装更新怎么办 Win10更新一直安装失败的3种解决方法...

    经常会有小伙伴反馈,Win10无法安装更新怎么办?其实,Windows 10更新方法有很大,总有一种方式可以解决问题.以下是Win10更新失败的三种解决方式,帮你轻松解决更新失败问题. Win10更新 ...

最新文章

  1. 【CUDA学习】GPU硬件结构
  2. Hyperledger Fabric 1.0 实战开发系列 第一课 系统环境搭建
  3. Linux内存释放脚本
  4. ajax 跨域请求api_【.NET Core 3.0】框架之十二 || 跨域 与 Proxy
  5. Conversion to Dalvik format failed with error 1
  6. Spring实战——通过Java代码装配bean
  7. 外媒揭晓华为Mate 30 Pro配置细节:新iPhone最大的对手
  8. SQLAlchemy Mapping Class Inheritance Hierarchies
  9. 大数据之-Hadoop完全分布式_RM启动注意事项---大数据之hadoop工作笔记0041
  10. FR获取当前控件位置值并转换(或赋值可参考)
  11. teamcity mysql 配置_TeamCity
  12. CSS中单位rem的使用说明
  13. GoLand tool tips
  14. 在Eclipse4.2x中安装最新版插件WindowsBuilder
  15. DEMATEL算法程序
  16. 用VBA代码打开xls文件时,判断被打开的xls文件是否含VBA代码并禁止其运行
  17. pimple学习(1)pimple的使用
  18. PUBGlite下载安装以及加速器详解
  19. 斑马射频打印机同时操作打印、写入EPC、读TID
  20. 智慧物业小程序_物业小程序物业微信小程序目前功能最全的物业小程序

热门文章

  1. 比较 Excel 中两列的差异,并用箭头标识和指向匹配结果
  2. 乐高ev3搭建图_乐高EV3机械爪合集
  3. 苹果笔记本能不能用python_“苹”除了苹果还能组哪些词?苹组词,释义及造句汇总!...
  4. highcharts ajax 数据格式,Highcharts ajax获取json对象动态生成报表生成 .
  5. grep从文件末尾开始找_新人自学前端到什么程度才能找工作?
  6. BugkuCTF-MISC题简单套娃
  7. hook控制浏览器的方法_Java-Hook技术-入门实践+反射、动态代理、热修复再看看
  8. 在无头单链表的一个非头节点前插入一个节点(C语言)
  9. matlab的try函数,matlab – 是否可以在没有try块的情况下测试函数句柄?
  10. php数组能不能静态,php 为什么常量可以用数组定义 静态变量却不能