解决php 5.3 deprecated 错误问题
2011-04-01 13:39
447 查看
php 5.3 从一方面来讲,可以说在07年计划PHP6的中的一个pre版本,增加了很多功能,统一了很多语法,使PHP变得更加强大与简洁。
说到统计架构规划,PHP当然会对一些别名,重复功能function进行归类整理,并把一些不用的正式在php 5.3以后删除掉.故不建议在新项目继续使用.
PHP 5.3 有两个deprecated,
E_DEPRECATED and E_USER_DEPRECATED
以下是在旧的项目中会在php 5.3以后碰到的问题
?define_syslog_variables
?register_globals
?register_long_arrays
?safe_mode
?magic_quotes_gpc
?magic_quotes_runtime
?magic_quotes_sybase
?在PHP.ini 注释用#已经不再建议使用.
Deprecated functions:
?call_user_method() 可以用 call_user_func() 替代
?call_user_method_array() 可以用 call_user_func_array() 替代define_syslog_variables()
?dl() 反对在使用DL加载扩展,php5.3 以后应用php.ini配制
?ereg() 可以用 preg_match() 替代
? ereg_replace() 可以用 preg_replace() 替代
?eregi() 用 preg_match() i 参数替代
?eregi_replace() 用 preg_replace() i 参数替代
?set_magic_quotes_runtime() 用 magic_quotes_runtime() 替代
?session_register() session_unregister() session_is_registered()
?以上三个统一用 $_SESSION 替代
?set_socket_blocking() 用 stream_set_blocking() 替代
?split() 用 preg_split() 替代
?spliti() 用 preg_split() 模式 ‘i’ 替代
?sql_regcase()
?mysql_db_query() 用 mysql_select_db() mysql_query() 替代mysql_escape_string() 用 use mysql_real_escape_string() 替代
?关于时区处理,统一用Timezone对像
Deprecated features:
?直接返加new 实例不再建议使用. PHP 6 将不再支持
?Call-time pass-by-reference 参数现在不再建议使用 PHP 6 将不再支持
?用 {} 访问字符串顺序不再建议使用. 统一用 [] 代替. PHP 6 将不再支持
当然如果项目紧急,又要在php 5.3 使用以上方法,可以用下面的方法去做
在php.ini 增加
cd /home/jiania/lnamp/php530/etc/php.ini
php_flag allow_call_time_pass_reference On
php_value error_reporting “E_ALL & ~E_NOTICE & ~E_DEPRECATED” 阅读全文
类别:about → php 查看评论
说到统计架构规划,PHP当然会对一些别名,重复功能function进行归类整理,并把一些不用的正式在php 5.3以后删除掉.故不建议在新项目继续使用.
PHP 5.3 有两个deprecated,
E_DEPRECATED and E_USER_DEPRECATED
以下是在旧的项目中会在php 5.3以后碰到的问题
?define_syslog_variables
?register_globals
?register_long_arrays
?safe_mode
?magic_quotes_gpc
?magic_quotes_runtime
?magic_quotes_sybase
?在PHP.ini 注释用#已经不再建议使用.
Deprecated functions:
?call_user_method() 可以用 call_user_func() 替代
?call_user_method_array() 可以用 call_user_func_array() 替代define_syslog_variables()
?dl() 反对在使用DL加载扩展,php5.3 以后应用php.ini配制
?ereg() 可以用 preg_match() 替代
? ereg_replace() 可以用 preg_replace() 替代
?eregi() 用 preg_match() i 参数替代
?eregi_replace() 用 preg_replace() i 参数替代
?set_magic_quotes_runtime() 用 magic_quotes_runtime() 替代
?session_register() session_unregister() session_is_registered()
?以上三个统一用 $_SESSION 替代
?set_socket_blocking() 用 stream_set_blocking() 替代
?split() 用 preg_split() 替代
?spliti() 用 preg_split() 模式 ‘i’ 替代
?sql_regcase()
?mysql_db_query() 用 mysql_select_db() mysql_query() 替代mysql_escape_string() 用 use mysql_real_escape_string() 替代
?关于时区处理,统一用Timezone对像
Deprecated features:
?直接返加new 实例不再建议使用. PHP 6 将不再支持
?Call-time pass-by-reference 参数现在不再建议使用 PHP 6 将不再支持
?用 {} 访问字符串顺序不再建议使用. 统一用 [] 代替. PHP 6 将不再支持
当然如果项目紧急,又要在php 5.3 使用以上方法,可以用下面的方法去做
在php.ini 增加
cd /home/jiania/lnamp/php530/etc/php.ini
php_flag allow_call_time_pass_reference On
php_value error_reporting “E_ALL & ~E_NOTICE & ~E_DEPRECATED” 阅读全文
类别:about → php 查看评论
相关文章推荐
- 解决php 5.3 deprecated 错误问题
- PHP5.3开发-解决DEPRECATED错误问题
- PHP5.3开发-解决DEPRECATED错误问题
- PHP 解决版本问题:"Assigning the return value of new by reference is deprecated"
- 解决IIS7 PHP HTTP 500内部服务器错误问题
- php5.3开始出现的Function ereg() is deprecated Error问题解决办法
- php版本从5.1升级到5.3遇到的问题与解决方式
- PHP遇到问题时怎么解决(错误日志)
- php出现内存位置访问无效错误问题解决方法
- php5.3 + cacti 出现 date_default_timezone_set() function 错误提示的解决方法
- date_default_timezone_set()问题解决方案(PHP5.3以上的)
- php5.3中ZendGuardLoader与wincache冲突问题的解决方法
- PHP中 header错误问题 的解决方法Cannot modify header information
- 解决php deprecated 的问题
- DedeCMS不支持PHP5.3、5.4及以上版本后台500错误白屏的解决方法
- 解决php5.3中Deprecated: Assigning the return value of new by reference is deprecated in报错
- 2015-3-18 学习出错问题解决--PHP Deprecated问题
- linux+php5.3版本出现错误死锁解决
- ecshop和Ucenter 通信失败终极解决方法!(附带php5.3以上,出现其他问题解决方法)
- 解决PHP时间显示提示错误的问题