curl不能访问本地域名lolocalhost window下的nginx

问题描述

我利用PHP脚本的CURL去请求自己本地服务器localhost,出现卡死,超时现象。

解决问题

两个php文件同时请求解析时,会出现阻塞问题、window配置下的nginx php-cgi不会出现多线程/子进程
php-cgi不能自动创建子进程,需要我们手动开启多个php-cgi进程,可以利用cmd窗口

E:\phpstudy\PHPTutorial\WWW>php -S localhost:8001  -t ./gjob  ## -t 后面的是入口文件 监测的端口是8001是请求curl填入的端口
PHP 7.3.1 Development Server started at Mon Apr  8 14:32:36 2019
Listening on http://localhost:8001
Document root is E:\phpstudy\PHPTutorial\WWW\gjob
Press Ctrl-C to quit.

##下面是请求访问的地址以及状态
[Mon Apr  8 14:33:06 2019] [::1]:58741 [200]: /
[Mon Apr  8 14:33:39 2019] [::1]:58796 [404]: /index.php/Admin
[Mon Apr  8 14:34:05 2019] [::1]:58837 [404]: /index.php/Admin/Api/Lottery/lists.html
[Mon Apr  8 14:34:17 2019] [::1]:58856 [200]: /index.php/Api/Lottery/lists.html

curl不能访问本地域名lolocalhost window下的nginx_第1张图片

使用加上端口

注意进程窗口不能关闭

在这里插入图片描述

你可能感兴趣的:(php,Nginx)