帮助中心 >  技术知识库 >  云服务器 >  服务器教程 >  Apache下“Cannot load php5apache2_4.dll into server”问题的解决方法

Apache下“Cannot load php5apache2_4.dll into server”问题的解决方法

2016-10-25 08:21:21 5401

下载了最新的PHP+Apache Httpd Server,版本号分别为5.5.0和2.4.3,完成配置修改后,启动Apache服务器,上报“Cannot load php5apache2_4.dll into server”错误。

1、以为是配置文件写错,仔细检查后,确实没有看出什么问题。

2、以为是采用了不匹配的线程安全版本,仔细检查后,PHP和Apache均是线程安全的版本。

3、排除法,删除httpd.conf中的这句话,Apache启动成功。Windows上的PHP和Apache采用dll动?链接库的方式配合,一种CGI方式,感觉问题出在dll上。

LoadModule php5_module "D:PHPphp5apache2_4.dll"

4、查找网上的一些帖子,各种分析较多,搞得我思路混乱。但我坚信问题一定不会是PHP和Apache两个组织?有相互测试配套关系,肯定是自己哪里理解错了,决定登录PHP官网,windows.php.net,找到下面一段话,人家说的很清楚:

Which version do I choose?

IISIf you are using PHP with IIS you should use the Non-Thread Safe (NTS) versions of PHP.

Apache
Please use the Apache builds provided by Apache Lounge. They also provide VC11 builds of Apache for x86 and x64. We use their binaries to build the Apache SAPIs.If you are using PHP with Apache 1 or Apache2 from apache.org (not recommended) you need to use the older VC6 versions of PHP compiled with the legacy Visual Studio 6 compiler. Do NOT use VC9+ versions of PHP with the apache.org binaries.

VC9 and VC11
More recent versions of PHP are built with VC9 or VC11 (Visual Studio 2008 and 2012 compiler respectively) and include improvements in performance and stability.

The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed.

查看系统的Visual Studio Distribute版本是2008,对应VC9,但我使用的是Visual Studio 2012编译的PHP版本(VC11),动态连接于Apache中的dll,可能就会出现问题。重新下载了VC9版本的PHP,Apache Httpd Server启动成功,问题解决!


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: