Home  >  Article  >  php教程  >  nagiosQL访问时报错PHP message: PHP Deprecated: preg

nagiosQL访问时报错PHP message: PHP Deprecated: preg

WBOY
WBOYOriginal
2016-06-06 19:59:341635browse

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 查

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,最终问题解决。

php-5.4.21下载地址为:http://www.php.net/downloads.php

此问题是由于nagiosql_320,当前未对php5.5进行良好的支持导致的,可能会在以后的版本发布中解决此问题。如果有哪位同仁已经解决此问题,希望能将修改后IT.php的代码发给我,我们共同进步。

注:

请尽量避免使用php-5.2.10,使用此版本时,需要配合fpm的patch(php-5.2.10-fpm-0.5.11.diff.gz)使用。

当使用此版本时,nginx日志会报错:

[error] 3977#0: *64947 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.12.30, server: 192.168.12.41, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.12.41:8082"

当使用此版本时,php-fpm日志会报错:

[NOTICE] fpm_got_signal(), line 48: received SIGCHLD
[WARNING] fpm_children_bury(), line 215: child 1861 (pool default) exited on signal 11 SIGSEGV (core dumped) after 2.962569 seconds from start
[NOTICE] fpm_children_make(), line 352: child 2663 (pool default) started

 如果以上两个报错请更新PHP至更高,如php-5.4.21

值得注意的是,我们在安装对PHP支持的页面时,一定要查看好当前页面对PHP版本的支持,否则极易出现各种问题。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn