2010年7月5日 星期一

PHP5.3放弃的函数,解决方法

Function ereg() is deprecated in

Function split() is deprecated in

Function eregi() is deprecated in

Function set_magic_quotes_runtime() is deprecated in

Function mysql_close() is deprecated in

php5.3被放弃的函数有:


ereg()
eregi();
set_magic_quotes_runtime();
split
mysql_close(); //将不支持全部关闭, 需要改为:mysql_close($link);


php5.3以下变更:


magic_quotes_gpc() 将永远为1;
Zend Optimizer 仍然没有支持.

解决方案:

修改php.ini中下面代码

;extension=php_mbstring.dll
改为
extension=php_mbstring.dll


;mbstring.func_overload = 0
修改为:
mbstring.func_overload = 7

ereg_replace() is deprecated
All ereg*-functions will be deprecated
split() is deprecated
All POSIX Regex function will be deprecated in PHP 5.3.
set_magic_quotes_runtime() is deprecated
mysql_escape_string() is deprecated
session_register(), session_unregister(), and session_is_registered() are now deprecated.
Use the $_SESSION superglobal array instead.

更多放弃和更新可以看这里:http://cvs.php.net/viewvc.cgi/php-src/UPGRADING?revision=PHP_5_3

set_magic_quotes_runtime() is deprecated

可以使用ini_set("magic_quotes_runtime", 0);来设置

修改php.ini
error_reporting(E_ALL & ~E_DEPRECATED);

沒有留言:

wibiya widget