在 Windows 7 手動搭建 WAMP (Windows Apache MySQL PHP) 開發環境,版本掌控度最高,適合學習與特定版本需求。
apache_2.2.x-win32-x86-openssl-0.9.8k.msi (32 位元範例)。D:\WAMP\Apache\ (自建 D:\WAMP\ 統一管理)。D:\WAMP\Apache\ → 完成。編輯 D:\WAMP\Apache\conf\httpd.conf (建議用 Notepad++):
# 載入 PHP 模組 (在 LoadModule 區塊新增)
LoadModule php5_module "D:/WAMP/PHP/php5apache2_2.dll"
PHPIniDir "D:/WAMP/PHP"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
# 網站根目錄 (自訂)
DocumentRoot "D:/WAMP/www"
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
D:\WAMP\PHP\。php.ini-development 為 php.ini,修改關鍵設定:extension_dir = "D:/WAMP/PHP/ext"extension=php_mysql.dll, extension=php_mysqli.dll, extension=php_pdo_mysql.dll, extension=php_gd2.dll, extension=php_mbstring.dll, extension=php_curl.dll, extension=php_openssl.dll 等。date.timezone = Asia/Taipei (或 Asia/Shanghai)D:\WAMP\MySQL\。D:\WAMP\www\phpmyadmin\。config.sample.inc.php 為 config.inc.php,設定 $cfg['Servers'][$i]['host'] = '127.0.0.1';、$cfg['Servers'][$i]['auth_type'] = 'cookie';、Blowfish 密鑰。https://localhost/phpmyadmin/ 登入管理資料庫。驗證:瀏覽器訪問 https://localhost/ 顯示 Apache 測試頁;https://localhost/phpinfo.php (內容 ) 顯示 PHP 資訊且載入 MySQL 擴充即成功。