为了账号安全,请及时绑定邮箱和手机立即绑定

nginx 运行一两天后,php文件就不响应了,但是css/html可以响应

nginx 运行一两天后,php文件就不响应了,但是css/html可以响应

PHP
精慕HU 2019-03-16 18:02:19
fastcgi配置: 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; } keepalive_timeout 65; #tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 128k; fastcgi_buffers 4 128k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; 主要运行的php文件: curl_setopt_array($curl, array( CURLOPT_URL =>$url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_SSL_VERIFYPEER=>false, CURLOPT_SSL_VERIFYHOST=>false, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "content-type: image/jpeg; charset=UTF-8" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { header('Content-type:text/html;charset=utf-8'); echo "cURL Error #:" . $err; } else { echo $response; } unset($response); unset($curl); nginx 报错信息: 2018/05/03 01:28:47 [error] 4832#4936: *2045 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 113.101.171.150, server: localhost, request: "GET /log.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.5211.me" 发起http请求时:返回状态 cancle status
查看完整描述

3 回答

?
30秒到达战场

TA贡献1828条经验 获得超6个赞

php挂了。看看是不是内存泄露。

查看完整回答
反对 回复 2019-03-18
?
临摹微笑

TA贡献1982条经验 获得超2个赞

为啥那么多fastcgi配置写在最后

查看完整回答
反对 回复 2019-03-18
?
MYYA

TA贡献1868条经验 获得超4个赞

你看下php cgi进程还在不在,可能挂了, linux下一般是php-fpm windows下可能是php-cgi 看下进程还在不在,还能不能运行程序

查看完整回答
反对 回复 2019-03-18
  • 3 回答
  • 0 关注
  • 885 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信