记一次504 Gateway Time-out
使用curl请求是超时,查了下资料原来是端口被占用,造成了死锁,记录下
首先要知道为什么会出现死锁?
在我们访问页面的时候这个端口进程就已经被使用,当我们再在页面中curl请求其他页面因为没有其他的端口,php-cgi当然还要使用9000,就造成了阻塞所以就死锁了。
运行环境:windows + nginx + php
解决方法:
打开cmd,执行
D:\App_self\phpstudy\PHPTutorial\php\php-7.0.12-nts\php-cgi.exe -b 127.0.0.1:9001 -c D:\App_self\phpstudy\PHPTutorial\php\php-7.0.12-nts\php.ini
注意,cmd窗口不要关闭
再在请求页的vhost配置文件中修改
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
这里的fastcgi_pass要改成127.0.0.1:9001,即cmd开启的端口。
over
推荐一个nginx+php-cgi的运行原理,很不错,要常看
http://www.cnblogs.com/mangguoxiansheng/p/5967745.html
记一次504 Gateway Time-out的更多相关文章
- 记一次 nginx 504 Gateway Time-out
今天程序在执行一项excel导出任务的时候 出现了nginx超时的提示 nginx 504 Gateway Time-out 排查过程: 查看该任务 发现内容是一个数据量20000条信息 每条信息有5 ...
- 记一次接口504 Gateway Time-out原因及解决方法
今天在刷新公司项目页面时发现有个板块一直刷新不出数据,最后发现接口报错(504 Gateway Time-out) 通过查看代码发现有个sql语句,如下,特别慢 select `vdc1`, ...
- tomcat 504 gateway time-out
今天有个环境ajax调用一个请求的时候,出现一个504 gateway time-out响应,原以为是nginx找不到资源的问题,恰当我们的服务器上又配置了nginx,看了配置文件,没有指向tomca ...
- 解决 502、504 Gateway Time-out(nginx)
一.504 Gateway Time-out问题常见于使用nginx作为web server的服务器的网站 我遇到这个问题是在升级discuz论坛的时候遇到的 一般看来, 这种情况可能是由于nginx ...
- fastcgi 性能初配 504 gateway time-out
情况一:由于nginx默认的fastcgi进程响应缓冲区太小造成 这种情况下导致fastcgi进程被挂起,如果fastcgi服务队这个挂起处理不是很好的话,就可能提示"504 Gateway ...
- 解决 504 Gateway Time-out和502 Bad Gateway(nginx)
504 Gateway Time-out 问题所在: 所请求的网关没有请求到,简单来说就是没有请求到可以执行的PHP-CGI. 一般看来, 这种情况可能是由于nginx默认的fastcgi进程响应的缓 ...
- Nginx + php-fpm 执行 PHP 脚本超时 报错 502 Bad Gateway + 504 Gateway Time-out 的解决办法
上周写好的发送邮件的计划任务只发送了一部分,检查计划任务日志,发现 502 Bad Gateway 的错误(已经在脚本中设置了 set_time_limit(0)). 后来在网上查找资料,可以通过以下 ...
- "504 Gateway Time-out"
"504 Gateway Time-out”是什么意思? 意思为:网关超时!
- 解决504 Gateway Time-out(nginx)
504 Gateway Time-out问题常见于使用nginx作为web server的服务器的网站 我遇到这个问题是在需要插入一万多条数据时候遇到的 一般看来, 这种情况可能是由于nginx默认的 ...
随机推荐
- logback日志配置
第一步:加入jar包.要加入slf4j和logback的jar包,slf4j需要的jar包为slf4j-api,logback需要2个jar包(logback-classic.logback-core ...
- SQL Server -- 回忆笔记(三):ADO.NET之C#操作数据库
SQL Server知识点回忆篇(三):ADO.NET之C#操作数据库 1.连接数据库 (1)创建连接字符串: 使用windows身份验证时的连接字符串: private string conStr= ...
- MySQL 5.7.13 的一个BUG
mysql今天从5.6切到5.7,在测试环境中,日志是全部打印的,发现打了一个警告: Incorrect string value: '\xD6\xD0\xB9\xFA\xB1\xEA...' for ...
- Eclipse安装Gradle插件
1.window下安装Gradle见https://www.cnblogs.com/felixzh/p/9203271.html2.eclipse中依次打开help>Install new so ...
- JavaScript 函数闭包的应用
一.模仿块级作用域 JavaScript 没有块级作用域的概念,那么可以模拟像java中将很多变量私有化封装起来,保护数据,防止数据泄漏,封装细节,这样安全性和可控性更高 function box(c ...
- 虚拟DOM和react中的diff算法总结
https://blog.csdn.net/qq_26708777/article/details/78107577 一.虚拟DOM 1.什么是虚拟DOM及原理 把真实DOM树,变成js ...
- python3 今日大纲 day05
1. 上周内容回顾 1. 闭包: 内层函数对外层函数变量的使用 def outer(): a = 10 def inner(): print(a) return inner ret = outer() ...
- Parallel 类并行任务(仅仅当执行耗时操作时,才有必要使用)
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using S ...
- Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
SpringBoot启动时的异常信息如下: "C:\Program Files\Java\jdk1.8.0_161\bin\java" ......... com.fangxing ...
- vuex state使用
访问vuex中的state值 方式1 <div>{{$store.state.count}}</div> 方式2 <template> <div id=&qu ...