解決php導致nginx報502 bad gateway錯誤問題

來源:互聯網
上載者:User

502 bad gateway不一定全是nginx,apache之類引起的,也有可能是由其他模組引起的,例如:php

1,查看php-fpm和nginx的log

# vim /var/log/nginx/error.log
recv() failed (104: Connection reset by peer) while reading response header from upstream
# vim /var/log/php-fpm/error.log
WARNING: [pool www] child 29522 exited on signal 11 (SIGSEGV - core dumped) after 2165.472759 seconds from start

2,由php的eaccelerator導致502 bad gateway錯誤

我根據上面的二個錯誤,在網上找方法大部分都說是由nginx或者apache引起的,最近並沒有動nginx的配置,不可能好好的就不行了,當看到有說php擴充apc,有可能會引起502 bad gateway時,因為eaccelerator根apc差不多,猜想會不會是eaccelerator引起502呢?

# mv /etc/php.d/eaccelerator.ini{,bak} 
# /etc/init.d/php-fpm restart 

重啟後問題解決。開始的時候,我以為是cache目錄和log目錄的許可權導致502的,就算改了所屬使用者,並且在加上777許可權,也還是502錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.