PHP5.9升级PHP7时,有哪些坑和php-fpm配置问题需要注意?

2026-04-03 11:521阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计341个文字,预计阅读时间需要2分钟。

PHP5.9升级PHP7时,有哪些坑和php-fpm配置问题需要注意?

Apache与PHP-FPM关系图:![Apache_event_php-fpm](https://i.imgur.com/5zQx0zQ.png)

PHP5.9升级PHP7时,有哪些坑和php-fpm配置问题需要注意?

Nginx与PHP-FPM关系图:![nginx-php-fpm](https://i.imgur.com/8y9z8y9.png)

工作模式:Worker-Master-ServerTCP协议NginxPHPNginx-FastCGI

1.使用$GET获取所有参数,例如:访问地址http://127.0.0.1/Home/String/index2

2.PHP7会多输出一个参数:_url

apache_event_php-fpm 示意图:

nginx-php-fpm示意图:

Worker-Master-Server

TCP-Nginx_PHP

Nginx-FastCGI

1、使用$_GET 获取所有参数,php7 会多出一个参数:_url ,例如访问的地址

127.0.0.1/Home/String/index2?a=12&b=19

此时的的参数_url = "Home/String/index2"

2、在PHP7 中为一个Error:PHP Notice: Undefined index: HTTP_USER_AGENT in line 2

php5.9则为一个notice

2017/03/27 10:58:09 [error] 5286#0: *851 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: HTTP_USER_AGENT in /home/UserAgent.php on line 9" while reading response header from upstream

解决:stackoverflow.com/questions/16330496/php-notice-undefined-index-unix:/var/run/php7.0.9-fpm.sock:", host: "127.0.0.1"

tinywan@tinywan:/usr/local/nginx/logs$ ll /var/run/php7.0.9-fpm.soc ls: 无法访问'/var/run/php7.0.9-fpm.sock': 没有那个文件或目录

搞了半天,原来php-fmp 没有启动,贵在坚持,相信自己.

相关推荐:《PHP教程》

标签:一些PHP

本文共计341个文字,预计阅读时间需要2分钟。

PHP5.9升级PHP7时,有哪些坑和php-fpm配置问题需要注意?

Apache与PHP-FPM关系图:![Apache_event_php-fpm](https://i.imgur.com/5zQx0zQ.png)

PHP5.9升级PHP7时,有哪些坑和php-fpm配置问题需要注意?

Nginx与PHP-FPM关系图:![nginx-php-fpm](https://i.imgur.com/8y9z8y9.png)

工作模式:Worker-Master-ServerTCP协议NginxPHPNginx-FastCGI

1.使用$GET获取所有参数,例如:访问地址http://127.0.0.1/Home/String/index2

2.PHP7会多输出一个参数:_url

apache_event_php-fpm 示意图:

nginx-php-fpm示意图:

Worker-Master-Server

TCP-Nginx_PHP

Nginx-FastCGI

1、使用$_GET 获取所有参数,php7 会多出一个参数:_url ,例如访问的地址

127.0.0.1/Home/String/index2?a=12&b=19

此时的的参数_url = "Home/String/index2"

2、在PHP7 中为一个Error:PHP Notice: Undefined index: HTTP_USER_AGENT in line 2

php5.9则为一个notice

2017/03/27 10:58:09 [error] 5286#0: *851 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: HTTP_USER_AGENT in /home/UserAgent.php on line 9" while reading response header from upstream

解决:stackoverflow.com/questions/16330496/php-notice-undefined-index-unix:/var/run/php7.0.9-fpm.sock:", host: "127.0.0.1"

tinywan@tinywan:/usr/local/nginx/logs$ ll /var/run/php7.0.9-fpm.soc ls: 无法访问'/var/run/php7.0.9-fpm.sock': 没有那个文件或目录

搞了半天,原来php-fmp 没有启动,贵在坚持,相信自己.

相关推荐:《PHP教程》

标签:一些PHP