2009-11-27 126 views
7

這成爲一個非常令人沮喪的問題。我正在嘗試乾淨安裝apache 2.2和PHP 5.2.11。一切似乎是正確配置,但PHP模塊沒有開始......PHP啓動:無法加載動態庫,Windows,Apache 2.2,PHP 5.2.11

PHP Warning: PHP Startup: Unable to load dynamic library '.;C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ext/php_mcrypt.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library '.;C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ext/php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library '.;C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ext/php_openssl.dll' - The specified module could not be found.\r\n in Unknown on line 0

在php.ini

include_path = ".;C:\Program Files (x86)\Apache Software Foundation\Apache2.2\php" 
extension_dir = ".;C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ext/" 

的所有文件都沒有......的.dll文件,如ssleay32.dll,libmcrypt.dll,libmysql.dll的,的libeay32.dll都安裝在...

C:/ Program Files文件(86)/ Apache軟件基金會/ APACHE2.2/PHP/

我還包括他們在C:\ Windows \ System32

甚至在Windows路徑中添加了C:/ Program Files(x86)/ Apache Software Foundation/Apache2.2/php /。

我不知道爲什麼這不起作用,它感覺像一個沒有勝利的情況。任何人有任何想法如何讓這一切工作正常?

回答

10

試試這個:

extension_dir = "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ext/" 

不與.;

+0

這一切都再次工作。現在我只需要弄清楚爲什麼OpenSSL和paypalewp在乾淨安裝後仍然無法正常工作......感謝您的答覆 – 2009-11-27 12:29:40

+0

樂意提供幫助! 如果您不能解決問題,請發佈有關您的OpenSSL問題的其他問題。也許周圍的人可以幫忙。 :) – 2009-11-27 12:31:23

+0

非常感謝你,它就像一個魅力! – 2015-04-13 10:45:38

1

開始只是爲了我的未來的自己,如果沒有別的。這是PHP 5.2.13在Windows上運行IIS 8

我得到了以下錯誤:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_openssl.dll' - The specified module could not be found.

phpinfo()加載的php.ini文件是C:\Program Files (x86)\PHP\php.ini

擴展目錄:

extension_dir ="C:\Program Files (x86)\PHP\ext" 

這些是php.ini文件的最後兩行:

[PHP_SQLSRV] 
extension=php_sqlsrv_52_nts_vc6.dll 
[PHP_OPENSSL] 
extension=php_openssl.dll 

php_openssl.dllphp_sqlsrv_52_nts_vc6.dll文件在ext目錄。 php_openssl.dll未損壞(與另一臺正在工作的機器上的文件大小相同)。

PHP將找到sqlsrv dll,但不是openssl dll。不知道爲什麼。沒有任何數量的IIS重新啓動。

解決方案,直到我知道更好的是,使用Windows PHP安裝程序安裝openssl.dll擴展。您可以重新運行安裝程序並選擇「更改」,並允許您添加或刪除庫。我現在看不到文件或php.ini文件有任何區別,但現在文件加載。

我居然懷疑我的問題是與此類似comment about OpenSSL installation on Windows

At this point, when you start Apache it will attempt to load php_openssl.dll, but if your setup is anything like mine you will see an error. I prefer to start Apache manually, and the error appears in a dialog box: "The ordinal 4114 could not be located in the dynamic link library LIBEAY32.dll". (I'm not sure whether you would get this message if you started Apache as a service). The Apache log also contains an error message saying that php_openssl.dll cannot be loaded, though that message doesn't name libeay32.dll. Welcome to DLL Hell.

Libeay32.dll enters the picture because php_openssl.dll depends on it (and also on ssleay32.dll). What I think happens is that Apache first tries to load php_openssl.dll programmatically from the path specified by the extension_dir key. But then, the loading of the so-called dependent DLLs is left to Windows' default mechanism. If Windows finds an incompatible version of a dependent DLL, you get the error.

我注意到了有關ssleay32.dll錯誤試圖運行命令行php -i時。我只是假設它沒有在環境中。IIS沒有提及其日誌中的任何ssleay32.dll錯誤。

+0

是的!有效。我從cmd運行Apache,使用從任務管理器,命令行列中複製的x:\ xampp \ apache \ bin \ httpd.exe -d x:/ xampp/apache命令)。它爲這兩個DLL拋出錯誤。我不得不將'ssleay32.dll'和'libeay32.dll'從php dir複製到apache \ bin。謝謝! – 2017-11-21 00:52:04

1

你只是取消註釋的extension_dir在php.ini

enter image description here

0

當初同樣的錯誤,但不是照搬加入PHP文件夾到系統路徑文件,並重申了服務器。

相關問題