php PHP启动:无法加载动态库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14040756/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP Startup: Unable to load dynamic library
提问by Nenhum Pois é
I am trying to use Firebird 2.5.2.26539 with:
我正在尝试将 Firebird 2.5.2.26539 与:
- Windows 8
- Apache 2.2.22
- PHP 5.4.10
- 视窗 8
- 阿帕奇 2.2.22
- PHP 5.4.10
When i enable the extensions of firebird in php:
当我在 php 中启用 firebird 的扩展时:
- extension=php_interbase.dll
- extension=php_pdo_firebird.dll
I get these errors:
我收到这些错误:
[26-Dec-2012 12:08:11 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_interbase.dll' - Impossible to locate the specified module. in Unknown on line 0
[26-Dec-2012 12:08:13 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_pdo_firebird.dll' - Impossible to locate the specified module. in Unknown on line 0
[2012 年 12 月 26 日 12:08:11 UTC] PHP 警告:PHP 启动:无法加载动态库 'C:\Program Files (x86)\PHP\ext\php_interbase.dll' - 无法找到指定的模块。在未知的第 0 行
[2012 年 12 月 26 日 12:08:13 UTC] PHP 警告:PHP 启动:无法加载动态库 'C:\Program Files (x86)\PHP\ext\php_pdo_firebird.dll' - 无法找到指定的模块。在未知的第 0 行
if i make PHP -a in command line, the error message is different: cannot find fbclient.dll.
如果我在命令行中创建 PHP -a,错误信息是不同的:找不到 fbclient.dll。
I have the flamerobin running and it opens the database. So i copy the fbclient.dll to the PHP root path. Then the errors change to:
我运行了flarobin,它打开了数据库。所以我将 fbclient.dll 复制到 PHP 根路径。然后错误更改为:
[26-Dec-2012 11:55:46 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_interbase.dll' - %1 is not a valid Win32 application. in Unknown on line 0
[26-Dec-2012 11:55:46 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_pdo_firebird.dll' - %1 is not a valid Win32 application. in Unknown on line 0
[2012 年 12 月 26 日 11:55:46 UTC] PHP 警告:PHP 启动:无法加载动态库 'C:\Program Files (x86)\PHP\ext\php_interbase.dll' - %1 不是有效的 Win32应用。在未知的第 0 行
[2012 年 12 月 26 日 11:55:46 UTC] PHP 警告:PHP 启动:无法加载动态库 'C:\Program Files (x86)\PHP\ext\php_pdo_firebird.dll' - %1 不是有效的 Win32应用。在未知的第 0 行
Can anyone help me on this one? I suspect that this version of Firebird still does not have the correct extensions made for the PHP. Thank you.
谁能帮我解决这个问题?我怀疑这个版本的 Firebird 仍然没有为 PHP 做正确的扩展。谢谢你。
采纳答案by Dan Belden
Cli and Apache PHP run with two different configuration files. That will explain the lacking error message in CLI mode. The likelihood is the extensions for this application where not stored in the PHP extension folder. I'm not versed with the configurations under windows so you may need to google for the Windows PHP extension directory and ensure your extension file is there.
Cli 和 Apache PHP 使用两个不同的配置文件运行。这将解释在 CLI 模式下缺少的错误消息。可能是该应用程序的扩展没有存储在 PHP 扩展文件夹中。我不熟悉 Windows 下的配置,因此您可能需要在 google 上搜索 Windows PHP 扩展目录并确保您的扩展文件在那里。
Judging by your error the path is "C:\Program files(x86)\PHP\ext\
根据你的错误判断路径是“C:\Program files(x86)\PHP\ext\
Please ensure your extension files are there before attempting to load them.
在尝试加载它们之前,请确保您的扩展文件在那里。
回答by Jan Derk
I am repeating the comment (which some might miss) by Nenhum Pois é above, because it is the real solution to the problem:
我在重复上面 Nenhum Poisé 的评论(有些人可能会错过),因为它是问题的真正解决方案:
The problem was the fbclient.dll from the FB 64 bits installation. I just got the fbclient.dll from 32bits, copy it into the PHP root and it solved the problem
问题是来自 FB 64 位安装的 fbclient.dll。我刚从 32 位获取 fbclient.dll,将其复制到 PHP 根目录中并解决了问题
回答by Gerold Meisinger
If you run on Windows check if your extension is compiled with the same Visual Studio compiler version as your PHP interpreter.
如果您在 Windows 上运行,请检查您的扩展是否使用与 PHP 解释器相同的 Visual Studio 编译器版本进行编译。
From PHP download page https://windows.php.net/download
从 PHP 下载页面https://windows.php.net/download
- PHP 7.3 = VC15
- PHP 7.1 = VC14
- PHP 5.6 = VC11
- PHP 7.3 = VC15
- PHP 7.1 = VC14
- PHP 5.6 = VC11
Whereas the MongoDB extension for examples is compiled with VC11, see https://pecl.php.net/package/mongo/1.6.16/windowsand check the DLL list filename for -vc11-
而示例的 MongoDB 扩展是使用 VC11 编译的,请参阅https://pecl.php.net/package/mongo/1.6.16/windows并检查 DLL 列表文件名-vc11-

