本文記錄在 Windows Server 2000/XP/2003 環境下,手動部署 IIS、PHP 5.1、MySQL 5.0、Zend Optimizer 2.6 及 phpMyAdmin 2.8 的完整安裝與設定流程。雖然版本較舊,但步驟邏輯對理解經典 ASP.NET/PHP 共存架構仍具參考價值。
假設系統盤為 C:,若非請自行替換路徑。
php-5.1.2-Win32.zip 解壓至 C:\php。C:\php\libmysql.dll 及 C:\php\ext\php_mysql.dll 複製至 C:\Windows\system32(Win2000 為 C:\WINNT\system32)。C:\php\php.ini-dist 至 C:\Windows(或 C:\WINNT)並更名為 php.ini。extension_dir = "C:\php\ext" 指向正確擴充模組目錄。;):
extension=php_gd2.dll ; 圖片處理,Discuz 水印需此模組
extension=php_mbstring.dll ; phpMyAdmin 需求
extension=php_mysql.dll ; MySQL 支援
PHPC:\php\php5isapi.dll.phpC:\php\php5isapi.dllindex.php 並移至最上層。net stop w3svc && net stop iisadmin && net start w3svc。https://localhost/phpinfo.php(內容為 <?php phpinfo(); ?>),確認 Server API 顯示 ISAPI。C:\MySQL,安裝過程選擇「稍後設定」。C:\MySQL\bin\mysqld-nt -install
net start mysql
C:\MySQL\bin\MySQLInstanceConfig.exe 依嚮導操作。mysql -u root -p 進入 MySQL 命令列(初始無密碼直接 Enter)。SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('your_password');mysqladmin -u root password 'your_password'。ZendOptimizer-2.6.2-Windows-i386.exe。php.ini。C:\Inetpub\wwwroot\phpmyadmin)。libraries/config.default.php 至根目錄並更名為 config.inc.php。$cfg['PmaAbsoluteUri'] = 'https://localhost/phpmyadmin/';
$cfg['blowfish_secret'] = 'your_password'; // 與 Root 密碼一致
$cfg['DefaultLang'] = 'zh-gb2312';
$cfg['DefaultCharset'] = 'gb2312';
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // 建議使用 cookie 驗證
https://localhost/phpmyadmin/,輸入 root 帳密登入管理資料庫。