apache自己停止了服务,然后再也启动不了了,查看error.log发现报错如下:


[Thu Jul 11 03:28:44 2013] [warn] pid file D:/Apache2.2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Thu Jul 11 03:28:44 2013] [notice] mod_bw : Memory Allocated 0 bytes (each conf takes 32 bytes)

[Thu Jul 11 03:28:44 2013] [notice] mod_bw : Version 0.8 - Initialized [0 Confs]

[Thu Jul 11 08:37:14 2013] [warn] pid file D:/Apache2.2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Thu Jul 11 08:37:14 2013] [notice] mod_bw : Memory Allocated 0 bytes (each conf takes 32 bytes)

[Thu Jul 11 08:37:14 2013] [notice] mod_bw : Version 0.8 - Initialized [0 Confs]

[Thu Jul 11 08:37:33 2013] [warn] pid file D:/Apache2.2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Thu Jul 11 08:37:34 2013] [notice] mod_bw : Memory Allocated 0 bytes (each conf takes 32 bytes)

[Thu Jul 11 08:37:34 2013] [notice] mod_bw : Version 0.8 - Initialized [0 Confs]

[Thu Jul 11 08:38:02 2013] [warn] pid file D:/Apache2.2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Thu Jul 11 08:38:02 2013] [notice] mod_bw : Memory Allocated 0 bytes (each conf takes 32 bytes)

[Thu Jul 11 08:38:02 2013] [notice] mod_bw : Version 0.8 - Initialized [0 Confs]

[Thu Jul 11 08:38:40 2013] [warn] pid file D:/Apache2.2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Thu Jul 11 08:38:40 2013] [notice] mod_bw : Memory Allocated 0 bytes (each conf takes 32 bytes)

[Thu Jul 11 08:38:40 2013] [notice] mod_bw : Version 0.8 - Initialized [0 Confs]


马上google百度下,原来是php.ini里面开启的扩展有问题。要么根本就加载不了,要么版本不兼容。


调试方法:首先将php.ini底部加载的所有扩展动态库(extension modules),看能否正常启动apache。如果不行就一个一个开启扩展测试。直到找到不兼容的extension。

我这里是php_openssl.dll扩展出了问题。下载的版本没有和当前php版本对应,导致php无法加载。