Windows XP 環境上安裝 PHP 5.2.6

來源:互聯網
上載者:User
Windows XP 環境下安裝 PHP 5.2.6.

該章節講述如何在 Windows XP 環境下安裝 PHP。

在安裝 PHP 之前,首先確認已經安裝 Apache HTTP Server。如何安裝 Apache HTTP Server,參見 Apache HTTP Server 安裝。

下載 PHP 5.2.6

PHP 的官方網站是 http://www.php.net/。

PHP 的下載頁面是 http://www.php.net/downloads.php,請選擇 Windows Binaries 下的 PHP 5.2.6 installer 連結,然後選擇一個鏡像網站 (比如cn2.php.net) 下載 PHP,你會得到一個名為 php-5.2.6-win32-installer.msi 的安裝檔案。

在 Windows XP 環境下安裝 PHP 5.2.6

雙擊 PHP 安裝檔案 php-5.2.6-win32-installer.msi,你會看到如下畫面:

點擊 Next,開始安裝,在 License 頁面選擇 I accept the terms in the License Agreement,如:

點擊 Next,進入 Destination Folder 畫面,如:

點擊 Next,進入 Web Server Setup 畫面,選擇 Apache 2.2.x Module,如:

點擊 Next,選擇 Apache 的設定檔所在的目錄,如:

預設狀態下,文字框裡顯示的是 C:\Program Files,你記得要自己通過 Browse 按鈕選擇 Apache 的設定檔目錄。

選擇好Apache 的設定檔目錄之後,點擊 Next,選擇要安裝的功能,如:

點擊 Next,準備安裝 PHP,如:

點擊 Install 按鈕,執行安裝。

安裝完成後,會顯示安裝結束畫面,如:

點擊 Finish,結束安裝。

修改 Apache 設定檔

安裝結束以後,我們還需要修改 Apache 的設定檔。檔案路徑為

C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf。

用 Notepad 開啟 httpd.conf,你會注意到在檔案最後有以 #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL 為開始,以 #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL 為結束的一段配置代碼。

請將這段代碼更新成:

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALLPHPIniDir "C:/Program Files/PHP/"LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"AddType application/x-httpd-php .php#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

儲存 Apache 設定檔 httpd.conf。

開啟 Apache Service

在 Windows 開始菜單選擇 Start --> All Programs --> Apache HTTP Server 2.2 --> Monitor Apache Servers,點擊後,你會看到在 Taskbar 有個小紅表徵圖,雙擊表徵圖開啟 Apache Service Monitor 畫面。

如果 Apache Service 沒有啟動,請點擊 Start 按鈕開啟 Apache Service;如果已經啟動,請點擊 Restart 按鈕重新啟動 Apache Service。

測試 PHP

用 Notepad 寫一個最簡單的 PHP 檔案,存成 test.php,儲存在 Apache htdocs 目錄下。


然後在瀏覽器中輸入 http://localhost:8080/test.php,頁面中應該只出現 “Blabla.cn” 字樣,而不是原始碼。

?作者或編者:布啦布啦 ??最新動向日期:2008-05.-16參考來源:www.BlaBla.cn
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.