WAMP PHP启动错误:无法加载动态库

12

我的WAMP服务器昨天完全正常工作。今天我不得不重新启动计算机,结果出了一些问题。服务器从未完全启动...任务栏图标始终为橙色。我的项目将会打开,但只有HTML被加载而没有PHP。这是PHP的错误日志...

[04-Oct-2014 01:36:27 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:36:27 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:36:27 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

[04-Oct-2014 01:36:27 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:36:27 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:36:27 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

[04-Oct-2014 01:37:28 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:37:28 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:37:28 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

[04-Oct-2014 01:37:29 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:37:29 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:37:29 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

[04-Oct-2014 01:38:42 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:38:42 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:38:42 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

[04-Oct-2014 01:38:43 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:38:43 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:38:43 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

[04-Oct-2014 01:44:47 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:44:47 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:44:47 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

[04-Oct-2014 01:44:48 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:44:48 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

 in Unknown on line 0

[04-Oct-2014 01:44:48 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'W:/wamp/bin/php/php5.5.12/ext/php_smtp.dll' - %1 is not a valid Win32 application.

 in Unknown on line 0

所有图书馆的文件仍然存在于正确的文件夹中。有人知道可能是什么原因吗?

更新:不确定为什么我有这么多不同版本,但是这里它们: visual c++ redistributable versions

更新:我完全重新安装了wamp,但仍然出现这些错误。


"%1 不是一个有效的 Win32 应用程序。" 你确定这些是32位库吗?或者你没有安装正确版本的 Visual C++ Redistributable。使用 http://www.dependencywalker.com/ 检查依赖项。 - Cheery
我已更新我的问题,包括已安装版本的屏幕截图。 - ShoeLace1291
通过链接运行程序 - 它将向您显示需要或缺失的其他dll。+ https://dev59.com/poLba4cB1Zd3GeqPbDCK + http://forum.wampserver.com/read.php?2,112211 - Cheery
这个问题似乎与编程无关,因此不适合在此提问。请到superuser.com上提问。 - Daniel W.
6个回答

19

这只是2.5安装过程中的小故障。

您需要做的就是:

使用wampmanager(系统托盘中的W图标)进行以下操作:

left click wampmanager -> Apache -> Version -> (and click on the version number)

这将导致wampmanager重建apache/bin文件夹中的所有符号链接,并重新启动Apache。这应该解决问题并停止错误出现在php错误日志中。


此外,如果您安装了新的.DLL(插件)并出现此错误,无法解决此问题,请确保已满足所安装的.DLL要求。(在我的情况下是操作系统) - Binod Kalathil

3
这是版本不匹配或缺少扩展dll的依赖项。
您可能需要安装Visual C++ Redistributable:
PHP VC9构建(5.4)需要您安装Visual Studio 2008 SP1 x86或x64的Visual C++ Redistributable。
VC11构建(5.5、5.6)需要您安装Visual Studio 2012 x86或x64的Visual C++ Redistributable。 php_ldap也可能需要libeay32.dll和ssleay32.dll,但这些文件是PHP分发的一部分。只有在它们被删除或PHP文件夹不在您的ENV PATH变量上时,才会出现问题。
尝试使用新的PHP下载:

所以我下载了PHP文件,将它们复制到正确的文件夹中并尝试重新启动服务器,但仍然没有变化。 - ShoeLace1291
你已经将 PHP 文件夹附加到系统 PATH 变量中了吗? - Jens A. Koch
为什么?将二进制文件的路径添加到Windows Path是一种常见做法。WampServer在这里有何不同之处? - Jens A. Koch
但是由于这完全是不必要的,所以我们不会这样做。只有在您无法正确配置Apache或者按照网络上的其他错误建议时才需要这样做,其中有很多。PHP和/或Apache版本切换器(自WAMPServer3起,重新创建符号链接)将正确的文件复制到活动或新选择的PHP版本的正确的apache/bin文件夹中。 - RiggsFolly
你认为这是不必要和不正确的,但事实并非如此。将可执行文件添加到环境路径只是另一种方法。在版本切换时,您必须更新符号链接,而我只需切换文件夹即可。由于所需的权限级别,符号链接始终存在问题。因为只有从Win10(14972)开始,才能使用mklink或通过WinAPI SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE创建符号链接,而无需将控制台提升为管理员。祝你在维护Vista和8的这种方法时好运。 - Jens A. Koch
显示剩余2条评论

0

在我添加了新的PHP版本到wamp(7.3.17)后,出现了这个问题。将路径wamp\bin\php\Path_of_your_PHP添加到环境变量PATH中可以解决这个问题。


0

这可以通过使用 Wamp 菜单进行更正。

检查您所拥有的 Apache 版本。它可能是 2.4.9

此处 所述,这将导致 WAMPServer 重新构建 apache2.4.9/bin 文件夹中所有 SYMLINK,并将正确的符号链接放入其中以用于这两个扩展。

因此,您需要编辑 \wamp\script\config.inc.php 并找到变量 $phpDllToCopy,并进行更改。

$phpDllToCopy = array (
'icudt52.dll', 
'icuin52.dll',
'icuio52.dll',
'icule52.dll',
'iculx52.dll',
'icutest52.dll',
'icutu52.dll',
'icuuc52.dll',
'icudt51.dll', 
'icuin51.dll',
'icuio51.dll',
'icule51.dll',
'iculx51.dll',
'icutest51.dll',
'icutu51.dll',
'icuuc51.dll',
'icudt50.dll', 
'icuin50.dll',
'icuio50.dll',
'icule50.dll',
'iculx50.dll',
'icutest50.dll',
'icutu50.dll',
'icuuc50.dll',
'icudt49.dll',
'icuin49.dll',
'icuio49.dll',
'icule49.dll',
'iculx49.dll',
'icutest49.dll',
'icutu49.dll',
'icuuc49.dll',
'libeay32.dll',
'libsasl.dll', 
'libintl.dll',
'php5isapi.dll',
'php5nsapi.dll',
'ssleay32.dll',
'php5ts.dll',
'fribidi.dll', 
'fdftk.dll',   
'libmcrypt.dll',
'libmhash.dll',
'libmysql.dll',
'libmysqli.dll',
'msql.dll',
'ntwdblib.dll',
'php5activescript.dll',
);

但是为什么需要创建符号链接或复制这些依赖项呢?如果找不到依赖项,很可能是路径问题。要么路径没有被添加,因此找不到DLL文件,要么路径查找顺序不正确,导致DLL和依赖项版本不匹配。无论如何,服务器堆栈应该为用户处理这个问题,而不是强迫他进行棘手的配置。我的观点是,它应该开箱即用,不需要用户交互,只需让PHP运行即可。 - Jens A. Koch
@JensA.Koch,使用WAMPServer时,路径不会因任何原因而被修改,因为可以有多个版本的PHP,并且可以通过单击菜单来激活和停用它们。如果使用了路径,则会使此功能变得更加复杂,因为PATH引用运行Apache/PHP或MYSQL是完全不必要的,因此WAMPserver不会这样做。 - RiggsFolly

-1

1
完全不必安装Visual Studio,只需要安装Visual C/C++运行库就可以了,不需要完整的VS。 - RiggsFolly

-2

解决了!!

我一直在遇到以下错误:

1)PHP启动:无法加载动态库“c:/wamp/bin/php/php5.5.12/ext/php_intl.dll”-指定的模块无法找到。

2)程序无法启动,因为MSVCP110.dll缺失于您的计算机。尝试重新安装该程序以解决此问题。

即使安装了Visual C++可再发行包,错误仍然存在。我将MSVCP110.dll复制到Windows\System32文件夹中解决了这个问题。现在它可以运行了!


1
这不是解决方案!MSVCP... dll 库文件不应该手动复制。它们应该被正确安装。 - RiggsFolly

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接