“Cannot load php5apache2_4.dll into server”問題的解決方案

來源:互聯網
上載者:User
解決方案:

版本-作業系統,要對應上。

php的win版本下載地址:http://windows.php.net/download/

apache的httpd對win系統的下載地址:http://www.anindya.com/

====

百度 這個文也能解決。http://jingyan.baidu.com/article/a378c9609e4152b32828308c.html

====

“Cannot load php5apache2_4.dll into server”問題的解決方案

下載了最新的PHP+Apache Httpd Server,版本號碼分別為5.5.0和2.4.3,完成配置修改後,啟動Apache伺服器,上報“Cannot load php5apache2_4.dll into server”錯誤。

1、以為是設定檔寫錯,仔細檢查後,確實沒有看出什麼問題。

2、以為是採用了不匹配的安全執行緒版本,仔細檢查後,PHP和Apache均是安全執行緒的版本。

3、排除法,刪除httpd.conf中的這句話,Apache啟動成功。Windows上的PHP和Apache採用dll動態連結程式庫的方式配合,一種CGI方式,感覺問題出在dll上。

LoadModule php5_module "D:\PHP\php5apache2_4.dll"

4、尋找網上的一些文章,各種分析較多,搞得我思路混亂。但我堅信問題一定不會是PHP和Apache兩個組織沒有相互測試配套關係,肯定是自己哪裡理解錯了,決定登入PHP官網, windows.php.net,找到下面一段話,人家說的很清楚:

Which version do I choose?IISIf you are using PHP with IIS you should use the Non-Thread Safe (NTS) versions of PHP.ApachePlease use the Apache builds provided by Apache Lounge. They also provide VC11 builds of Apache for x86 and x64. We use their binaries to build the Apache SAPIs.If you are using PHP with Apache 1 or Apache2 from apache.org (not recommended) you need to use the older VC6 versions of PHP compiled with the legacy Visual Studio 6 compiler. Do NOT use VC9+ versions of PHP with the apache.org binaries.VC9 and VC11More recent versions of PHP are built with VC9 or VC11 (Visual Studio 2008 and 2012 compiler respectively) and include improvements in performance and stability.The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed.

查看系統的Visual Studio Distribute版本是2008,對應VC9,但我使用的是Visual Studio 2012編譯的PHP版本(VC11),動態串連於Apache中的dll,可能就會出現問題。重新下載了VC9版本的PHP,Apache Httpd Server啟動成功,問題解決!

下載開源軟體時,要特別注意編譯環境的版本, 仔細閱讀軟體的版本ReleaseNotes,往往能解決絕大多數問題。

+

+

+

-

-

-

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.