WindowXP下PHP5開發環境配置

來源:互聯網
上載者:User
文章目錄
  • Which version do I choose?

、下載
(1)apache 
      httpd-2.2.21-win32-x86-no_ssl.msi
(2)php 
      官網下載頁面:http://windows.php.net/download/
      注意,當前官網只有兩類版本5.3.8(VC9編譯)、5.2.17(VC6編譯)
      按官網的說法

Which version do I choose?

If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP

If you are using PHP with IIS you should use the VC9 versions of PHP
   
    我選擇了php-5.3.8-Win32-VC9-x86.zip、php-5.2.17-Win32-VC6-x86.zip分別實驗

2、安裝配置Apache
       安裝路徑F:\Apache2.2。
       系統預設的網頁的部署路徑在F:\Apache2.2\htdocs下。
       在IE中輸入localhost可以看到“It works”,說明安裝成功。
       可以編輯F:\Apache2.2\conf\httpd.conf檔案來修改網頁的部署路徑,這裡暫不修改,就使用系統的預設網頁部署路徑

3、安裝配置PHP
(1) php5.3.8
      將PHP壓縮包解壓,放倒F盤並重新命名為F:\PHP5.3.8
      找到檔案php.ini-development,改名為php.ini,開啟。
      搜到extension_dir,改寫為extension_dir = "F:\PHP5.3.8\ext"
      搜到doc_root,改寫為doc_root = "F:\Apache2.2\htdocs"
      再搜extension_dir,把下面這些選項前的分號去掉
           extension=php_mbstring.dll   這個不選的話用phpMyAdmin會出現紅色提示
           extension=php_dba.dll
           extension=php_dbase.dll
           extension=php_filepro.dll    可選
           extension=php_gd2.dll     支援GD庫的,一般要滴
           extension=php_imap.dll               可選
           extension=php_ldap.dll
           extension=php_mysql.dll    支援MySQL的
      網上說的要把php.ini複製到C:\Windows下,把php5ts.dll複製到C:\Windows\system32下並沒有用上
(2)配置php5.2.17
      開啟檔案php.ini-dist,其他與上面配置php5.3.8類似

4、配置Apache
開啟F:\Apache2.2\conf\httpd.conf
(1)搜到最後一個#LoadModule,在下一行添加如下代碼
LoadModule php5_module "F:/PHP5.3.8/php5apache2_2.dll"  
AddType application/x-httpd-php .php 
# 配置 php.ini 的路徑  
PHPIniDir "F:/PHP5.3.8"
(2)搜到DirectoryIndex,在index.html後添加index.php,記得和index.html之間有空格
(3)重啟apach

5、測試
編輯一個文字檔,內容如下
<?php

phpinfo();
?>

儲存為index.php,放倒網頁的部署路徑下(F:\Apache2.2\htdocs)
在IE中輸入http://localhost/index.php,看到php的配置資訊頁面。
其中這看到這一項,說明配置成功

轉載至:http://www.cppblog.com/jack-wang/archive/2011/12/10/161874.aspx

Loaded Configuration File

F:\PHP5.3.8\php.ini

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.