Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 伺服器技術 >> 關於伺服器

Windows 下啟用 PHP cURL 擴展完整步驟

編輯:關於伺服器

在 Windows 環境(IIS/Apache)中啟用 PHP cURL 擴展的標準流程:

1. 修改 php.ini

找到 php.ini,搜尋 extension=php_curl.dll,移除行首分號 ; 啟用:

extension=php_curl.dll

2. 複製必要 DLL 到系統目錄

將以下三個檔案從 PHP 安裝目錄複製到 %windir%\system32\(或 C:\Windows\System32\):

  • php_curl.dll
  • libeay32.dll (OpenSSL 相依)
  • ssleay32.dll (OpenSSL 相依)

3. 重啟 Web 伺服器

  • IIS:執行 iisreset 或在服務管理中重啟「World Wide Web Publishing Service」。
  • Apache:重啟 Apache 服務。

驗證是否生效

建立 phpinfo.php:

<?php phpinfo(); ?>

瀏覽該頁面,搜尋「curl」區塊,顯示版本資訊即表示成功載入。

常見問題: 若仍報錯,請確認 PHP 版本(TS/NTS)、VC 編譯版本(VC11/VC14/VC15)與 DLL 檔案完全匹配;建議從官方 PECL 下載對應版本套件。

Copyright © Windows教程網 All Rights Reserved