本教學示範在 IIS 5.0 上安裝 PHP 5.2.3、MySQL 5 並整合 phpMyAdmin 的完整步驟。(註:版本較舊,現代環境建議使用 IIS 10+、PHP 8.x、MySQL 8.0)
D:\PHPD:\temp,將 ext 資料夾與 php_mysql.dll 複製到 D:\PHPD:\PHP\php5isapi.dll,副檔名設 .phpphp 對應實體資料夾index.php,內容:<?php phpinfo(); ?>https://localhost/php/index.php 應顯示 PHP 資訊頁PHP 5 預設不支援 MySQL,需修改 php.ini(位於 PHP 安裝目錄):
;extension_dir = "./"
extension_dir = "d:\php\ext"
路徑必須正確,否則無法載入 DLL。
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_mysql.dll
移除前面分號,重啟 IIS 即可載入。
mysql-essential-5.1.57-win32.msi 安裝至 D:\MySQLD:\PHP\phpMyAdminconfig.sample.inc.php 為 config.inc.php$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '你的密碼';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
phpmyadmin 指向該資料夾https://localhost/phpmyadmin/ 登入管理php_mysql.dll 存在於 ext 目錄、extension_dir 路徑正確、libmysql.dll 在系統 PATH 中php.ini 中 display_errors = On 除錯mbstring 設定正確