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

IIS 架設 PHP + MySQL + Zend 圖文教學 (Windows 2000 環境)

編輯:關於伺服器

環境準備

  • 作業系統目錄:C:\WINNT
  • PHP 版本:4.3.10 (Windows Binaries),安裝目錄 C:\PHP
  • MySQL 版本:4.0.22-win
  • Zend Optimizer:v2.5.5

安裝步驟

  1. 將 PHP 壓縮包解壓至 C:\PHP。
  2. 將 php.ini-dist 更名為 php.ini。
  3. 複製 php.ini、php.exe 到 C:\WINNT。
  4. 複製 php4ts.dll 與 php4isapi.dll (位於 sapi 目錄) 到 C:\WINNT\system32。

PHP 設定 (php.ini)

  1. 用記事本開啟 php.ini,搜尋 extension_dir,將值 ./ 改為 C:\PHP\extensions。
  2. 搜尋 ;Windows Extensions,將所需擴充模組前的分號 ; 移除啟用 (部分模組可能不支援)。

IIS 設定

  1. 建立 PHP 測試目錄 (如 D:\WEB),在「網際網路服務管理員」中右鍵「預設網站」→「新增」→「虛擬目錄」,別名 web,路徑 D:\web,給予讀取、執行指令碼、瀏覽權限。
  2. IIS ISAPI 篩選器中新增 PHP 篩選器 (指向 php4isapi.dll)。
  3. 在「應用程式對應」中新增副檔名 .php 對應至 php4isapi.dll (採用 ISAPI 模式)。

測試

在測試目錄建立 test.php,內容:<?php phpinfo(); ?>,瀏覽器訪問 https://localhost/web/test.php 若顯示 PHP 資訊頁即代表成功。

備註

本教學基於 Windows 2000 / IIS 5.0 環境,其他系統請參照調整路徑與版本。PHP 4 系列已停止維護,生產環境建議升級至 PHP 7/8 並搭配 IIS 7+ 使用 FastCGI 模式。

Copyright © Windows教程網 All Rights Reserved