PHP 安裝錯誤Unable to load dynamic library

來源:互聯網
上載者:User

好久沒有用php

今天安裝了一下出現

Unable to load dynamic library 'C:/Program Files/PHP/ext/php_mysql.dll

 

原因:php_mysql.dll依賴於libmysql.dll

雖然php安裝目錄下有這個檔案,而且我也將php_mysql.dll加入環境變數,但是還是不起作用.

原因不明.

 

解決方案:

將php_mysql.dll拷貝到system32下

 

php_mysql.dll

可以在mysql或者php安裝目錄下找到

 

 

---------------------------------------------------

原因已經查明:

對於新設定的環境變數

需要重新啟動才能夠有效,通過phpinfo()函數可以看出這點

 

 

 

//翻了一下原來的學習日誌,一樣的問題,多花了這麼多時間

一起貼出來了

Apache 錯誤記錄檔提示 Unable to load dynamic library ...php_mysql.dll?
暈了,apache 錯誤記錄檔一直提示 Unable to load dynamic library ...,比如 php_mysql.dll等,明明php_mysql.dll就擺在extension_dir (= "D:/Programs/php/php-5.2.3/ext")下的!而且同樣目錄下的 php_gd2.dll 都能正確載入 ...
 
搗鼓了半天,才發現:
 
php_mysql.dll 的正確載入是需要 libmysql.dll,這個 libmysql.dll 是在 php 的安裝目錄(D:/Programs/php/php-5.2.3/)下的,不是在D:/Programs/php/php-5.2.3/ext 目錄,因此由於找不到 libmysql.dll,一直提示無法載入 php_mysql.dll
 
解決方案:
1. 把 libmysql.DLL 檔案拷貝到 %windir%/system32 目錄下;
2. 把 php 的安裝目錄 (D:/Programs/php/php-5.2.3/) 加入系統 %PATH% 環境變數中;

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.