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

WinXP 安裝 Apache + MySQL + PHP (WAMP) 環境完整手冊:httpd.conf、php.ini 關鍵設定

編輯:關於 Windows

WAMP 手動部署核心在於:

1. 讓系統預載 PHP DLL

  • 法一:複製 DLL 至 C:\Windows\System32。
  • 法二:將 PHP 目錄加入系統 PATH 環境變數。
  • 法三:修改 php.ini extension_dir = "D:/php5/ext"(需重啟 Apache)。

2. Apache 解析 .php

編輯 httpd.conf 与 php.ini:

  • DocumentRoot 指向專案根目錄(兩處)。
  • DirectoryIndex 加入 index.php。
  • 載入模組:LoadModule php5_module D:/php5/php5apache2.dll、PHPIniDir "D:/php"、AddType application/x-httpd-php .php .html。

3. php.ini 關鍵設定

  • register_globals = Off(建議,僅用 $_POST/$_GET)。
  • 啟用必要擴充:php_gd2.dll、php_mbstring.dll、php_mcrypt.dll、php_mysql.dll、php_mysqli.dll(移除前置分號)。

快速部署技巧:保留已調好的 httpd.conf、php.ini,新環境僅改 DocumentRoot 兩處即可。

WinXP 下 WAMP 手動配置完整指引,適合開發者參考。

Copyright © Windows教程網 All Rights Reserved