php-fpm+nginx環境下只顯示The page you are looking for is temporarily unavailable

來源:互聯網
上載者:User

今天在升級wordpress的時候,過程中突然出現“The page you are looking for is temporarily unavailable”錯誤,但在php、php-fpm和nginx的日誌中均沒有發現php的錯誤資訊,將php.ini中的display_errors開啟也沒有php錯誤出現,在網站根目錄下面寫了個phpinfo可以正常運行,重啟php依然如故,但重啟了nginx之後網站訪問就正常了。

原來wordpress升級的過程中因為比較耗時,造成php-cgi的進程過多,使用

netstat -anpo | grep "php-cgi" | wc -l

命令查看結果輸出0,表示PHP FastCGI的進程數太大了,修改nginx conf目錄下的scgi_params檔案,將預設的 scgi_param SCGI 1; 修改為 scgi_param SCGI 5;。也可以在nginx.conf中將fastcgi的逾時時間設定長一些,比如:

 http {
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 64k;
  fastcgi_buffers 4 64k;
}

最後一定要重啟php和nginx。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.