![PHP 扩展导致 Windows 7 64 位上的 Apache HTTP 服务器崩溃](https://linux22.com/image/518505/PHP%20%E6%89%A9%E5%B1%95%E5%AF%BC%E8%87%B4%20Windows%207%2064%20%E4%BD%8D%E4%B8%8A%E7%9A%84%20Apache%20HTTP%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%B4%A9%E6%BA%83.png)
- Apache 2.2.15(32 位)
- PHP 5.3.2 VC6 线程安全(32 位)
- Windows 7 旗舰版(64 位)
- 英特尔酷睿 2 双核 T7200 2 GHz
Apache Service Monitor 可以识别 PHP,但如果在 PHP.ini 中启用任何扩展,它就会崩溃。如果我禁用它们,如下所示,它就可以正常工作。
;[PHP_BZ2]
;extension=php_bz2.dll
;[PHP_CURL]
;extension=php_curl.dll
;[PHP_GD2]
;extension=php_gd2.dll
;[PHP_GETTEXT]
;extension=php_gettext.dll
;[PHP_IMAP]
;extension=php_imap.dll
;[PHP_MBSTRING]
;extension=php_mbstring.dll
;[PHP_MYSQL]
;extension=php_mysql.dll
;[PHP_MYSQLI]
;extension=php_mysqli.dll
;[PHP_OPENSSL]
;extension=php_openssl.dll
;[PHP_PDO_MYSQL]
;extension=php_pdo_mysql.dll
;[PHP_PDO_ODBC]
;extension=php_pdo_odbc.dll
;[PHP_PDO_SQLITE]
;extension=php_pdo_sqlite.dll
;[PHP_PGSQL]
;extension=php_pgsql.dll
;[PHP_SOAP]
;extension=php_soap.dll
;[PHP_SOCKETS]
;extension=php_sockets.dll
;[PHP_SQLITE3]
;extension=php_sqlite3.dll
;[PHP_TIDY]
;extension=php_tidy.dll
;[PHP_XMLRPC]
;extension=php_xmlrpc.dll
;[PHP_XSL]
;extension=php_xsl.dll
;[PHP_EXIF]
;extension=php_exif.dll
更新:根据 Ignacio 的建议在 httpd 上运行 Dependency Walker,它返回以下内容:
IESHIMS.DLL Error opening file. The system cannot find the file specified (2).
日志中包含以下内容:
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
对于模块(使用 mod_alias 作为示例):
LIBAPR-1.DLL Error opening file. The system cannot find the file specified (2).
LIBAPRUTIL-1.DLL Error opening file. The system cannot find the file specified (2).
LIBHTTPD.DLL Error opening file. The system cannot find the file specified (2).
日志:
Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
答案1
使用 PHP 与 httpd 时崩溃的典型原因是库不匹配。使用依赖性遍历器在 httpd 以及扩展上查找库冲突。
答案2
重新安装 Apache 和 PHP 在某种程度上解决了这个问题。