鍍金池/ 問(wèn)答/PHP  Linux  網(wǎng)絡(luò)安全/ nginx 運(yùn)行一兩天后,php文件就不響應(yīng)了,但是css/html可以響應(yīng)

nginx 運(yùn)行一兩天后,php文件就不響應(yīng)了,但是css/html可以響應(yīng)

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;

主要運(yùn)行的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 報(bào)錯(cuò)信息:

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"

發(fā)起http請(qǐng)求時(shí):返回狀態(tài) cancle status

回答
編輯回答
孤巷

php掛了??纯词遣皇莾?nèi)存泄露。

2017年3月12日 05:50
編輯回答
情殺

為啥那么多fastcgi配置寫(xiě)在最后

2018年6月28日 10:35
編輯回答
夏夕

你看下php cgi進(jìn)程還在不在,可能掛了, linux下一般是php-fpm windows下可能是php-cgi 看下進(jìn)程還在不在,還能不能運(yùn)行程序

2018年1月14日 17:17