三步解決搭建PHP環境問題_PHP教程

來源:互聯網
上載者:User
進行正確的搭建

搭建PHP環境一、安裝Apache 2.2.x

下載地址:http://httpd.apache.org/

一路斷行符號即可安裝。 注意安裝完成後要執行:D:Apache2.2bin>httpd -k install

假設,安裝在D:盤下。

Installing the Apache2.2 service
The Apache2.2 service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
httpd: Could not reliably determine the server's fully qualified domain name, us
ing 192.168.28.100 for ServerName

執行後,在案頭右下腳開啟Monitor Apache Servers 並啟動Apache 2.2服務

搭建PHP環境二、安裝PHP

下載地址:http://cn2.php.net/get/php-4.4.9-Win32.zip/from/a/mirror

下載 php-5.2.6-Win32.zip

(1)將PHP檔案解壓到一個目錄下,目錄位址為 "D:php"。
(2)將PHP目錄(D:php)下的php.ini-dist複製到windows(有的系統是winnt目錄)目錄下,並改名為php.ini。
(3)複製D:php目錄下的所有dll檔案到windows的系統檔案夾裡,即:C:windowssystem32。

注意:如果不想複製(3)的檔案,可以把 D:php 目錄加入系統PATH變數中

搭建PHP環境三、Apache 與 PHP 的整合

開始菜單的程式的Apache HTTP Server 2.2.4,再進入下一級的Configure Apache Server,這時可以看到那個Edit the Apache httpd.conf Configuration File。點一下。
尋找:
#LoadModule ssl_module modules/mod_ssl.so
在下面添加:
LoadModule php5_module "d:/local/php/php5apache2_2.dll"
尋找:
DirectoryIndex index.html
替換:
DirectoryIndex index.html index.htm index.php default.php
尋找:
AddType application/x-gzip .gz .tgz
在下面添加:
AddType application/x-httpd-php .php
Apache配置結束,現在開始進行PHP配置,用Notepad開啟C:windowsphp.ini。
尋找:
extension_dir = "./"
替換:
extension_dir = "d:/local/php/ext/"
尋找:
upload_max_filesize = 2M
這裡的意思為修改上傳檔案的最大限制,預設為2M,可以改為6M。
尋找:
;extension=php_mbstring.dll
將前面的;號去掉。
尋找:
;extension=php_gd2.dll
將前面的;號去掉。
尋找:
;extension=mysql.dll
將前面的;號去掉。
尋找:
;date.timezone =
替換:
date.timezone = PRC
檔案修改完畢,此時,雙擊右下角工作列的Apache表徵圖,彈出的視窗中,點Stop停止服務,等停止後再點Start啟動服務,此時,可以看到其視窗的狀態列中會顯示:"Apache/2.2.4 (Win32) PHP/5.2.0"。搭建PHP環境的配置全部完成。


http://www.bkjia.com/PHPjc/446082.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/446082.htmlTechArticle進行正確的搭建 搭建PHP環境一、安裝Apache 2.2.x 下載地址:http://httpd.apache.org/ 一路斷行符號即可安裝。 注意安裝完成後要執行:D:Apache2.2binhtt...

  • 聯繫我們

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