Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows Server 2003 IIS 6.0 支援 PHP + MySQL 環境建置教學

編輯:Windows Server 常見問題解答

在 Windows Server 2003 IIS 6.0 上手動部署 PHP 4.3.2 + MySQL 環境,解決 404 錯誤與擴展對應問題。

PHP 部署步驟

  1. 解壓 PHP 至 C:\php-4.3.2-Win32,將 php.ini-recommended 重命名為 php.ini
  2. 修改 php.ini:
    extension_dir = "C:\php-4.3.2-Win32\extensions"
    session.save_path = "C:\php-4.3.2-Win32\sessions" (需手動建立 sessions 資料夾)
  3. 複製 php.ini 至 C:\WINNT,php4ts.dll 至 C:\WINNT\system32
  4. IIS 管理員 → 網站屬性 → ISAPI 篩選器 → 新增:名稱 php、可執行檔 C:\php-4.3.2-Win32\sapi\php4isapi.dll
  5. 主目錄 → 應用程式設定 → 配置 → 新增對應:副檔名 .php、可執行檔 C:\php-4.3.2-Win32\sapi\php4isapi.dll
  6. 重啟 IIS,建立 phpinfo.php 驗證

MySQL + phpMyAdmin

  • MySQL 安裝預設路徑 C:\mysql,將 my-example.cnf 改名 my.cnf 複製至 C:\
  • phpMyAdmin 解壓至 C:\phpMyAdmin,修改 config.inc.php3 第 65 行語言設定為中文

ISAPI 篩選器設定 應用程式擴展對應

完成後 IIS 即可正常解析 PHP 腳本並連接 MySQL 資料庫。

Copyright © Windows教程網 All Rights Reserved