Dedecms PHP5.3 ereg_replace失效的解决办法

| | Comments (1)



Dedecms 系统其实还是可以的,起码属于开源的网站程序,用户如果有能力也是可以修改的,唯一的不足是更新过于缓慢,大概人手不是很多,盈利也是个问题,大多使用免费版,使用商业版本的不多。对于dedecms的ereg_replace函数其实是老早的问题了,大概2010年高级版本的php已经出现,同时ereg_replace已经失效,因此如果是一个积极的网站程序早就解决的该问题,而dede时至今日最新版本中也没有修正这个问题,导致程序在 php5.3以上会出现Deprecated: Function ereg_replace() is deprecated 。

如今,php版本的兼容时间段已经过去,除非自己的服务器可以控制php版本来解决这个问题,安转低版本php,如果没有独立服务器只能自己解决了。请安装错误提示,找到相应的文件行数,用preg_replace()函数代替ereg_replace函数:

找到:
define('DEDEADMIN', ereg_replace("[/\\]{1,}", '/', dirname(__FILE__) ) );
替换成:
define('DEDEADMIN', preg_replace("/[\/\\\\]{1,}/", '/', dirname(__FILE__) ) );


单点日志http://spoint.babyshoot.cn


1 Comments

把 ereg_replace() 换成 str_ireplace() 吧,
一样用的

Leave a comment


Type the characters you see in the picture above.

Archives

Ads by google

Pages

Powered by Movable Type 4.24-en

About this Entry

This page contains a single entry by 单点日志 published on August 12, 2011 1:57 PM.

World Wide Web(www),万维网20周年! was the previous entry in this blog.

上海瑞创投资管理有限公司是骗子公司 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.