今日電腦上的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的方法:
netsh winsock reset
使用此條命令恢復後,重啟電腦,這下Apache恢復當原先的良好狀態了。
希望遇見這樣問題的朋友們能得到幫助~~!