服務器用的是阿里云,安裝的是PhpStudy,每過幾小時,就會出現網站無法訪問的情況,服務器出現這個錯誤。但PhpStudy并沒有報錯退出,只要然后點擊“關閉程序”結束這個窗口,網站就能恢復訪問。
我嘗試了以下方式,但是都沒能解決問題:
將服務器內存從2GB升級到4GB;
在PhpStudy中將PHP版本切換至7.0.12;
將X:phpStudyPHPTutorialApacheconfextrahttpd-mpm.conf中的ThreadsPerChild值增加至1500
<IfModule mpm_winnt_module>
ThreadsPerChild 1500
MaxRequestsPerChild 3000
</IfModule>
將X:phpStudyPHPTutorialMySQLmy.ini中的query_cache_size值修改為256M
query_cache_size=256M
分別嘗試將以下3個文件復制到C:WindowsSystem32:
D:phpStudyPHPTutorialMySQLliblibmysql.dllD:phpStudyPHPTutorialphpphp-5.2.17libmysql.dllD:phpStudylibmysql.dll
以上方式都是Google出來的相關解決方案,但都沒能解決這個問題,依舊是過幾小時就會報錯導致網站無法訪問,求教大家是怎么回事?
錯誤日志(X:phpStudyPHPTutorialApachelogserror.log)相關信息:[Sun Apr 15 15:26:37.318002 2018] [mpm_winnt:notice] [pid 21256:tid 516] AH00363: Child: Terminating 149 threads that failed to exit.[Sun Apr 15 15:26:37.318980 2018] [mpm_winnt:notice] [pid 21256:tid 516] AH00364: Child: All worker threads have exited.[Sun Apr 15 17:20:57.704416 2018] [mpm_winnt:notice] [pid 20736:tid 508] AH00428: Parent: child process 21256 exited with status 3221225477 -- Restarting.[Sun Apr 15 17:20:57.966144 2018] [mpm_winnt:notice] [pid 20736:tid 508] AH00455: Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.4.45 configured -- resuming normal operations[Sun Apr 15 17:20:57.966144 2018] [mpm_winnt:notice] [pid 20736:tid 508] AH00456: Server built: Jul 1 2016 16:42:20[Sun Apr 15 17:20:57.967120 2018] [core:notice] [pid 20736:tid 508] AH00094: Command line: 'X:\phpStudy\PHPTutorial\Apache\bin\httpd.exe -d D:/phpStudy/PHPTutorial/Apache'[Sun Apr 15 17:20:57.971046 2018] [mpm_winnt:notice] [pid 20736:tid 508] AH00418: Parent: Created child process 14368[Sun Apr 15 17:20:59.030613 2018] [mpm_winnt:notice] [pid 14368:tid 516] AH00354: Child: Starting 150 worker threads.[Sun Apr 15 17:20:59.047219 2018] [mpm_winnt:error] [pid 14368:tid 3188] AH00326: Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
有大量的:[Fri Apr 20 17:33:06.965644 2018] [fcgid:error] [pid 14892:tid 588] FastCGI process 10700 still did not exit, terminating forcefully
最近一次出錯時的最后兩行錯誤信息:[Fri Apr 20 18:38:12.859160 2018] [mpm_winnt:notice] [pid 8908:tid 488] AH00363: Child: Terminating 647 threads that failed to exit.[Fri Apr 20 18:38:12.870901 2018] [mpm_winnt:notice] [pid 8908:tid 488] AH00364: Child: All worker threads have exited.
7 回答

慕姐8265434
TA貢獻1813條經驗 獲得超2個贊
- phpStudy我覺得比較適合的場景,是本地測試環境,放服務器上我覺得還是不太適合,看起來并沒有比WAMP更靠譜
- 做運維,看起來越輕松的,坑就越大。比如phpStudy很傻瓜吧?面板還是中文的,這不鬧脾氣趴窩了不是?并且由于集成度高,你都不好確定是哪里出的問題……當然我承認這點有失偏頗,但是阿里云上,同樣的低配,win系就得1G內存起,Linux512就給跑,這總說明問題吧?
- ……選Linux的話,其實也不難,首先市場里配好的鏡像一堆,直接選鏡像再按教程跑遍基礎配置,快的很。倒是win系這邊,也就占個圖形化的優勢,配起來并沒容易很多,反而抵消掉圖形的這點優勢了。
- 好像這個回答并沒有什么幫助……好吧那么建議題主試試WAMP,或者干脆就用IIS算了。我記得好像微軟自己也有個matrix什么的套件吧?如果還能搜到也可以試試,畢竟是它們自家的。

慕哥6287543
TA貢獻1831條經驗 獲得超10個贊
這個。。。在線上我是沒有用過這個phpstudy啦。但是我本地用的時候也有出現過類似的錯誤的。這是因為你的請求數量過大或者是CPU耗盡引起的。解決方法很簡單,代碼重新寫,或者換一個高配的環境。。。小白見解,各位勿噴哈。。?!緍uning...】
- 7 回答
- 0 關注
- 2670 瀏覽
添加回答
舉報
0/150
提交
取消