| 元件 | 版本 | 安裝路徑 |
|---|---|---|
| Apache | 2.0.50 | D:\Apache2 |
| PHP | 5.0.0 | D:\PHP |
| MySQL | 4.0.20 | D:\MySQL |
| phpMyAdmin | 2.5.7 | D:\Website\phpmyadmin |
D:\PHPphp.ini-dist → D:\Windows\php.iniphp5ts.dll、libmysql.dll → D:\Windows\System32php.ini:extension_dir = "D:/PHP/ext/",啟用 extension=php_mysql.dll# 編碼
AddDefaultCharset GB2312
# 站點根目錄
DocumentRoot "D:/Website"
# 預設首頁
DirectoryIndex index.html index.htm index.php
# 模組模式載入 PHP (推薦)
LoadModule php5_module D:/PHP/php5apache2.dll
AddType application/x-httpd-php .php
# 或 CGI 模式
ScriptAlias /php/ "D:/PHP/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"
config.inc.php:$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'your_password';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
在 D:\Website 建立 test.php:
<?php phpinfo(); ?>
瀏覽 https://localhost/test.php 應顯示 PHP 5 資訊、MySQL 支援已啟用。
php --ini 查看實際載入路徑)