2014-11-23 139 views
2

我在Windows 8.1机器上设置了开发环境。在Windows 8.1上安装PHP 5.6后,Apache 2.2无法启动

我成功安装了Apache 2.2,并下载了php-5.6.3-Win32-VC11-x86。

添加以下线在httpd.conf文件的末尾

PHPIniDir "C:/PHP5" 
LoadModule php5_module "C:/PHP5/php5apache2_4.dll" 
AddType application/x-httpd-php .php 
AddHandler application/x-httpd-php .php 

我还添加了

application/x-httpd-php .php 

myme.types文件

如果我注释掉PHPIniDirLoadModule Apache会正常启动。

此外,所有扩展上PHP.ini文件注释掉,并扩展目录设置为

extension_dir = "ext" 

任何帮助将非常感激。

编辑1: 错误日志中的唯一事情是关于服务器shutdow

[Sun Nov 23 14:56:07 2014] [notice] Parent: Received shutdown signal -- Shutting down the server. 
[Sun Nov 23 14:56:07 2014] [notice] Child 6192: Exit event signaled. Child process is ending. 
[Sun Nov 23 14:56:08 2014] [notice] Child 6192: Released the start mutex 
[Sun Nov 23 14:56:09 2014] [notice] Child 6192: All worker threads have exited. 
[Sun Nov 23 14:56:09 2014] [notice] Child 6192: Child process is exiting 
[Sun Nov 23 14:56:09 2014] [notice] Parent: Child process exited successfully. 

回答

2

检查是否存在错误的Apache日志文件!看看什么

你提到apache 2.2,但你使用的是一个名为php5apache2_4.dll的DLL。 这个dll是根据专门为apache 2.4构建的名称。这可能会导致问题,在php website上的Windows 2.2的Apache 2.2的最后一个PHP版本是PHP 5.4.35。

+0

感谢您的帮助。所以你有什么建议?升级Apache或降级PHP? – Morez 2014-11-23 17:01:21

+0

我会建议升级Apache,这样你就可以使用最新的PHP版本和最新的PHP功能。除非你特别想用较老的php版本进行测试,因为你想确保你的代码也运行在较老的php版本上。 – user254948 2014-11-23 17:07:16

+0

谢谢,现在一切正常,我已经升级到Apache 2.4(并将PHPIniDir放在最后一行)。 – Morez 2014-11-24 03:57:52