zliyt 发表于 2015-8-28 09:03:51

nagiosQL访问时报错PHP message: PHP Deprecated: preg_replace(): The /e modifier is de

  nagiosQL安装环境:
  CentOS release 6.4 (Final)
  php-5.5.4
  nagiosql_320
  nginx version: nginx/1.2.3
  
  安装一切正常,当访问nagiosQL界面时会提示:
  PHP Deprecated:preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
  
  查看nginx日志提示:
  PHP message: PHP Deprecated:preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
  
  解决方法:
  由于方法preg_replace()为PHP 5.5.x 中废弃的特性,官方建议需要在代码中将preg_replace()替换为函数preg_replace_callback,可以问题解决。 (具体请见官方介绍:
  http://www.php.net/manual/zh/migration55.deprecated.php)
  此问题涉及到nagiosQL文件:/usr/local/nagios/nagiosql/libraries/pear/HTML/Template/IT.php
  由于本人并不太熟悉PHP语法,故暂无法通过替换函数解决。
  故无奈之下将PHP版本恢复至php-5.4.21,最终问题解决。
  此问题是由于nagiosql_320,当前未对php5.5进行良好的支持导致的,可能会在以后的版本发布中解决此问题。如果有哪位同仁已经解决此问题,希望能将修改后IT.php的代码发给我,我们共同进步。
  
  值得注意的是,我们在安装对PHP支持的页面时,一定要查看好当前页面对PHP版本的支持,否则极易出现各种问题。
  
  
页: [1]
查看完整版本: nagiosQL访问时报错PHP message: PHP Deprecated: preg_replace(): The /e modifier is de