出现Deprecated: Function ereg_replace() is deprecated in 的原因及解决方法
在 php5.3环境下运行oscommerce,常常会出现Deprecated: Function ereg() is deprecated in...和Deprecated: Function ereg_replace() is deprecated in...这些类型的报错提示。
其原因在于:php5.3以上的版本不支持ereg()函数,而是使用preg_match()函数;不支持ereg_replace()函数,而使用preg_replace()函数。
解决方法一:退回去用php5.2
解决方法二:继续用php5.3,但是修改devel/devel.modul的460行:if ($errno &
(E_ALL ^ E_NOTICE)) {改为if ($errno &
(E_ALL&~E_NOTICE&~E_DEPRECATED)) }把 deprecated错误给忽略掉
解决方法三:将不支持的函数修改为支持的函数即可。
例如:
Deprecated: Function eregi() is deprecated in D:\www\oscommerce\catalog\includes\classes\language.php on line 87
那么,将87行的
if(eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i])
改为:
if(preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i])
再例如:
Deprecated: Function ereg_replace() is deprecated in C:\wamp\www\includes\functions\general.php on line 61
那么,将61行的
$string = ereg_replace(' +', ' ', trim($string));
改为:
$string = preg_replace('{ +}', ' ', trim($string));
如此类推,其它类似的错误也可以按照上面两个函数的语法来做修改。
出现Deprecated: Function ereg_replace() is deprecated in 的原因及解决方法的更多相关文章
- 【转】Deprecated: Function ereg_replace() is deprecated的解决方法
这个问题是因为你用的php版本过高. 在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继续用.有两个方案可以解决以上问题: 1.把php版本换到v5.3下. 2.继续使用 ...
- php 版本升高后 会出现 之Deprecated: Function ereg_replace() is deprecated的解决方法
这个问题是因为php版本过高. 在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继续用.有两个方案可以解决以上问题: 1.把php版本换到v5.3下. 2.继续使用v5. ...
- [Php] Deprecated: Function ereg_replace() is deprecated
From: http://www.zxyf.net/n6805c18.shtml 这个问题是因为你用的php版本过高. 在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继 ...
- PHP报错Deprecated: Function ereg_replace() is deprecated in
可能用了PHP5.3乃至更高的PHP版本,目前DEDE中有很多地方的正则函数都用的ereg_replace,而这个函数现在在PHP5.3中已经被废止了. 解决办法: 如果一定要用php5.3,请修改p ...
- 安装完出现Deprecated: Function ereg_replace() is deprecated in
php5.3说明 先不要用php5.3吧,毕竟目前版本要修改这个工作量太大,而且可能会有很多未知错误,这只能在下一版全部改用perl的正则了,都不明白php官方发 什么神经,此外不支持应该是直接屏 ...
- Deprecated: Function split() is deprecated in ... 解决办法
本地测试的程序上传到服务器出现很多错误,Deprecated: Function split() is deprecated 查了原因是因为PHP的版本不同所导致的,本身程序开发的时候用的是PHP5 ...
- PHP:错误 Deprecated: Function split() is deprecated in ... 解决办法
PHP:错误 Deprecated: Function split() is deprecated in ... 解决办法 PHP5.3 split() 不建议使用的原因:PHP 5.3.0 之后的r ...
- PHP Deprecated: Function split() is deprecated in /var/www/html/cacti/cmd.php on line 61
[root@localhost cacti]# php cmd.php PHP Deprecated: Function split() is deprecated in /var/www/html/ ...
- php5.3不支持 ereg、ereg_replace等函数问题,如提示:Deprecated: Function ereg() is deprecated
在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继续用.有两个方案可以解决以上问题: 1.把php版本换到v5.3下. 2.继续使用v5.3,修改php.ini文件 ;e ...
随机推荐
- Chapter 1 Securing Your Server and Network(12):保护链接server
原文出处:http://blog.csdn.net/dba_huangzj/article/details/38438363.专题文件夹:http://blog.csdn.net/dba_huangz ...
- table在 点击线条颜色
效果图: <html> <head> <meta http-equiv="Content-Type" content="text/html; ...
- zepto.js 源码注释备份
/* Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - zeptojs.com/license */ ;(funct ...
- hibernate 多对多 最佳实践
首先 看看我们 ER 画画 :盖 一对一 .一对多 .多对多 的关系 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvem91dG9uZ3l1YW4=/fo ...
- 如何获得 oracle RAC 11g asm spfile S档
方法一: [root@vmrac1 ~]# su - grid [grid@vmrac1 ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 ...
- OpenCV功能界面和示例
OpenCV2.4.9 API Reference http://docs.opencv.org/modules/refman.html 版权声明:本文博客原创文章,博客,未经同意,不得转载.
- [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法
原文:[jQuery1.9]Cannot read property 'msie' of undefined错误的解决方法 $.browser在jQuery1.9里被删除了,所以项目的js代码里用到$ ...
- Flex4 Alert PopupManager 演示样本
Flex4中间PopupManager分类似模仿桌面用户界面弹出窗体,有些人还喜欢JS弹出屏幕操作,底层接口灰色禁用掉. 创建需要要喷射形式的文件,码如下面: <?xml version=&qu ...
- org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: 的解决方案
1.错误信息 org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist ...
- Java代码优化(转)
前言 代码优化,一个很重要的课题.可能有些人觉得没用,一些细小的地方有什么好修改的,改与不改对于代码的运行效率有什么影响呢?这个问题我是这么考虑的,就像大海里面的鲸鱼一样,它吃一条小虾米有用吗?没用, ...