PHP Startup: Unable to load dynamic library

狂风中的少年 提交于 2019-11-28 03:41:05

问题


I am trying to use Firebird 2.5.2.26539 with:

  • Windows 8
  • Apache 2.2.22
  • PHP 5.4.10

When i enable the extensions of firebird in php:

- 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

if i make PHP -a in command line, the error message is different: cannot find 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:

[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

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.


回答1:


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.

Judging by your error the path is "C:\Program files(x86)\PHP\ext\

Please ensure your extension files are there before attempting to load them.




回答2:


I am repeating the comment (which some might miss) by Nenhum Pois é above, because it is the real solution to the problem:

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




回答3:


If you run on Windows check if your extension is compiled with the same Visual Studio compiler version as your PHP interpreter.

From PHP download page https://windows.php.net/download

  • 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/windows and check the DLL list filename for -vc11-



来源:https://stackoverflow.com/questions/14040756/php-startup-unable-to-load-dynamic-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!