apache無法運行 PHP 常見問題 : Cannot load C:/php-5.6.40/php5ts.dll into server
發表於 : 2025-09-23, 13:36
問題:
無法載入 php5ts.dll
這個錯誤訊息是說 Apache 伺服器在啟動時,無法載入 PHP 的動態連結庫檔案 php5ts.dll。
錯誤訊息中亂碼的部分,翻譯過來大概是「找不到指定的模組」。
造成這個錯誤的常見原因:
1. php5ts.dll 檔案不存在或路徑錯誤 (一般不太會出這個錯)
2. 缺少依賴函式庫: PHP 檔案 php5ts.dll 在啟動時,可能需要其他 DLL 檔案來支援。如果你的系統缺少這些 DLL,就會造成無法載入。例如,PHP 5.6 版本的 php5ts.dll 需要 Visual C++ Redistributable 程式庫才能正常運作。不同版本需要不同的 vcredist_x64.exe 套件.
例如:
Visual C++ Redistributable for Visual Studio 2012
Visual C++ Redistributable for Visual Studio 20xx
下載並安裝 VC++ 套件,重啟 apache 即可正常運行.
這串亂碼使用 Big5 編碼翻譯過來就是「找不到指定的模組」C:\Apache24\bin>httpd.exe -t
httpd.exe: Syntax error on line 749 of C:/Apache24/conf/httpd.conf: Cannot load C:/php-5.6.40/php5ts.dll into server: \xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xbc\xd2\xb2\xd5\xa1C
無法載入 php5ts.dll
這個錯誤訊息是說 Apache 伺服器在啟動時,無法載入 PHP 的動態連結庫檔案 php5ts.dll。
錯誤訊息中亂碼的部分,翻譯過來大概是「找不到指定的模組」。
造成這個錯誤的常見原因:
1. php5ts.dll 檔案不存在或路徑錯誤 (一般不太會出這個錯)
2. 缺少依賴函式庫: PHP 檔案 php5ts.dll 在啟動時,可能需要其他 DLL 檔案來支援。如果你的系統缺少這些 DLL,就會造成無法載入。例如,PHP 5.6 版本的 php5ts.dll 需要 Visual C++ Redistributable 程式庫才能正常運作。不同版本需要不同的 vcredist_x64.exe 套件.
例如:
Visual C++ Redistributable for Visual Studio 2012
Visual C++ Redistributable for Visual Studio 20xx
下載並安裝 VC++ 套件,重啟 apache 即可正常運行.