服务器用的是阿里云,安装的是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 回答
![?](http://img1.sycdn.imooc.com/5333a1d100010c2602000200-100-100.jpg)
慕姐8265434
TA贡献1813条经验 获得超2个赞
- phpStudy我觉得比较适合的场景,是本地测试环境,放服务器上我觉得还是不太适合,看起来并没有比WAMP更靠谱
- 做运维,看起来越轻松的,坑就越大。比如phpStudy很傻瓜吧?面板还是中文的,这不闹脾气趴窝了不是?并且由于集成度高,你都不好确定是哪里出的问题……当然我承认这点有失偏颇,但是阿里云上,同样的低配,win系就得1G内存起,Linux512就给跑,这总说明问题吧?
- ……选Linux的话,其实也不难,首先市场里配好的镜像一堆,直接选镜像再按教程跑遍基础配置,快的很。倒是win系这边,也就占个图形化的优势,配起来并没容易很多,反而抵消掉图形的这点优势了。
- 好像这个回答并没有什么帮助……好吧那么建议题主试试WAMP,或者干脆就用IIS算了。我记得好像微软自己也有个matrix什么的套件吧?如果还能搜到也可以试试,毕竟是它们自家的。
![?](http://img1.sycdn.imooc.com/5333a1d100010c2602000200-100-100.jpg)
慕哥6287543
TA贡献1831条经验 获得超10个赞
这个。。。在线上我是没有用过这个phpstudy啦。但是我本地用的时候也有出现过类似的错误的。这是因为你的请求数量过大或者是CPU耗尽引起的。解决方法很简单,代码重新写,或者换一个高配的环境。。。小白见解,各位勿喷哈。。。【runing...】
- 7 回答
- 0 关注
- 2634 浏览
添加回答
举报
0/150
提交
取消