【发布时间】:2018-03-04 06:56:54
【问题描述】:
今天我已将 XAMPP 的内部结构迁移到 64 位:
- Apache(从 32 位 2.4.25 到 64 位 2.4.27)
- PHP(从 32 位 7.1.4 到 64 位 7.1.9)
我已经下载了之前在 32 位中使用的每个扩展,安装、配置(如果需要,主要复制和粘贴路径更改)并且通常一切都“正常”。
-> % php --version
PHP 7.1.9 (cli) (built: Aug 30 2017 18:34:46) ( ZTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
但不知何故,即使有有效的 DLL(其中大部分捆绑在下载的 PHP 包中),我也会收到 PHP Startup: Unable to load dynamic library 错误。这些是curl、intl、ldap和imagick(最后一个是我安装的)。 php.ini 中的路径是正确的(许多其他扩展从同一目录正确加载)。这是我每次通过 Apache 访问页面时在php_error_log 中得到的:
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_curl.dll' - The specified module could not be found.
in Unknown on line 0
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_intl.dll' - The specified module could not be found.
in Unknown on line 0
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_ldap.dll' - The specified module could not be found.
in Unknown on line 0
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_imagick.dll' - The specified module could not be found.
in Unknown on line 0
在 CLI 中一切正常(与 Apache 相同的 php.ini):
-> % php -i | grep -n3 curl
175:curl
178-cURL Information => 7.55.0
-> % php -i | grep -n3 ldap
347:ldap
349-LDAP Support => enabled
350-RCS Version => $Id: 0779387e5f88edc656159d12b9302a053e82cc79 $
-> % php -i | grep -n3 intl
330:intl
332-Internationalization support => enabled
333-version => 1.1.0
335-ICU Data version => 57.1
但在 Apache 中我有 Attempted to call function "curl_init" ... 错误:(
有什么想法吗?
【问题讨论】:
-
首先确保 apache 的 php.ini 开启了 log_errors,然后发布错误日志。不过,最有可能的是,dll 是为不同版本的 php 编译的。如果是这种情况,错误日志会告诉您,并帮助我们帮助您。我也认为这个问题应该在Serverfault中
-
3 个扩展与 PHP 捆绑在一起(从官方网站下载),因此它们是有效的(并且在 CLI 中工作)。只有
imagick是自定义的,但我选择了匹配版本(VC14、x64、PHP7.1、TS)。我启用了日志,但只有我上面发布的错误:PHP Startup: Unable to load dynamic library,仅此而已。 PHP 和 Apache 日志(在调试级别)不包含任何可以告诉我发生了什么的内容。我很困惑。