Apache错误:[error] (OS 10038)在一个非套接字上尝试了一个操作
今日电脑上的APACHE启动后CPU占用率一直高居100%, PHP程序也无法执行了。
查看错误日志里面记录了很多:
[error] (OS 10038)在一个非套接字上尝试了一个操作。 : Child 3356: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive.
去到网上搜索,找到下面的解决方法:
编辑httpd.conf
Win32DisableAcceptEx ##加入这行
ThreadsPerChild 250
MaxRequestsPerChild 0
重启apache就解决了。
修改后还是不行,任然有错误记录,CPU占用率是降低了,但是还是没有恢复到原来的状态.logs里面还是一直在记录下面的错误报告。
[Mon Dec 24 16:48:06 2007] [error] (OS 10038)在一个非套接字上尝试了一个操作。 : Too many errors in select loop. Child process exiting.
[Mon Dec 24 16:48:06 2007] [notice] Child 1916: Exit event signaled. Child process is ending.
[Mon Dec 24 16:48:07 2007] [notice] Child 1916: Released the start mutex
[Mon Dec 24 16:48:07 2007] [notice] Child 1916: Waiting for 250 worker threads to exit.
[Mon Dec 24 16:48:07 2007] [notice] Child 1916: All worker threads have exited.
[Mon Dec 24 16:48:07 2007] [notice] Child 1916: Child process is exiting
[Mon Dec 24 16:48:07 2007] [notice] Parent: child process exited with status 0 -- Restarting.
[Mon Dec 24 16:48:07 2007] [notice] Apache/2.0.55 (Win32) configured -- resuming normal operations
[Mon Dec 24 16:48:07 2007] [notice] Server built: Oct 9 2005 19:16:56
[Mon Dec 24 16:48:07 2007] [notice] Parent: Created child process 3028
[Mon Dec 24 16:48:07 2007] [notice] Disabled use of AcceptEx() WinSock2 API
[Mon Dec 24 16:48:07 2007] [notice] Child 3028: Child process is running
[Mon Dec 24 16:48:07 2007] [notice] Child 3028: Acquired the start mutex.
[Mon Dec 24 16:48:07 2007] [notice] Child 3028: Starting 250 worker threads.
[Mon Dec 24 16:48:08 2007] [notice] Child 3028: Listening on port 80.
最后搜索到与winsock有关,有网友也出现了这个问题,他认为是金山毒霸或者升级精灵修改了WINSOCK导致的。我没有安装但是系统经常自动更新,别的软件也有,可能会有冲突,改下没有错 呵呵。于是搜索到恢复Winsock的方法:
cmd下
netsh winsock reset
使用此条命令恢复后,重启电脑,这下Apache恢复当原先的良好状态了。