Windows XP 下 PHP 5.4.7 和 Apache 2.2 出现问题

Windows XP 下 PHP 5.4.7 和 Apache 2.2 出现问题

我正在尝试在运行 Windows XP Home(已完全更新)的虚拟机上设置测试环境,其中包含 Apache 2.2 和 PHP 5.4.7。

我可以在 httpd.conf 中加载 PHP 5 模块,如果我不将 php.ini-DEVELOPMENT(或 -PRODUCTION)文件重命名为 php.ini,引擎就可以正常工作。

这个基本配置没有加载 MySQL 模块,所以我必须将 .ini-DEVELOPMENT 重命名为 .ini 并进行如下编辑:

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "C:/php/ext/"
...
extension=php_mysql.dll
extension=php_mysqli.dll

重新启动 Apache 没有任何问题,但我得到的只是一个空白页。我在哪里可以看到一些错误,或者您知道问题出在哪里吗?

如果我需要发布其他内容来向您提供更多详细信息,请告诉我。

答案1

要弄清楚问题是什么,请搜索错误报告显示错误配置指令php.ini文件。

error_reporting  =  E_ALL

; Print out errors (as a part of the output).  For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below).  Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On

; Even when display_errors is on, errors that occur during PHP's startup
; sequence are not displayed.  It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = On


; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = On

另请检查 apache 日志文件。

相关内容