apache_event_php-fpm 表示图:
nginx-php-fpm表示图:
Worker-Master-Server
TCP-Nginx_PHP
Nginx-FastCGI
一、应用$_GET 猎取一切参数,php7 会多出一个参数:_url ,例如拜访的地点
http://127.0.0.1/Home/String/index2?a=12&b=19
此时的的参数_url = "Home/String/index2"
二、正在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
处理:http://stackoverflow.com/questions/16330496/php-notice-undefined-index-http-user-agent-in-line-2
if(!empty($_SERVER['HTTP_USER_AGENT'])){ $user_agent = $_SERVER['HTTP_USER_AGENT']; } else { $user_agent = ''; }
三、NULL
兼并运算符 ,PHP7才正式退出了??
这个运算符:
// 猎取user参数的值(假如为空,则用'nobody') $username = $_GET['user'] ?? 'nobody'; // 等价于: $username = isset($_GET['user']) ? $_GET['user'] : 'nobody';
四、php-fpm
不启动的结果
2017/03/31 20:56:19 [crit] 19288#0: *1 connect() to unix:/var/run/php7.0.9-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: www.phalcon3.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://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教程》
以上就是PHP5.9 晋级到PHP7 遇到的一些坑(php-fpm 图解)的具体内容,更多请存眷资源魔其它相干文章!
标签: php7开发教程 php7开发资料 php7开发自学 PHP5.9 升级到PHP7
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
抱歉,评论功能暂时关闭!