php環境搭建

來源:互聯網
上載者:User

標籤:http   io   ar   檔案   sp   c   on   cti   html   

一、php下載安裝:php-5.6.1-Win32-VC11-x64.zip。解壓,操作:

  1、複製php.ini-production,更名為php.ini

  2、在環境變數PATH末尾添加:D:\programming\php-5.6.1-Win32-VC11-x64;D:\programming\php-5.6.1-Win32-VC11-x64\ext;

  3、常用擴充設定:

    a、開啟php.ini

      將; extension_dir = "ext"修改為 extension_dir = "ext" (去掉extension前面的分號)

      將;extension=php_mbstring.dll 修改為 extension=php_mbstring.dll(去掉extension前面的分號,這是php多位元組字串擴充)

      將;extension=php_mysql.dll修改為 extension=php_mysql.dll(去掉extension前面的分號)

      將;extension=php_mysqli.dll 修改為 extension=php_mysqli.dll(去掉extension前面的分號)

二、apache下載安裝。仔細找binaries,裡面msi格式檔案。httpd-2.2.25-win32-x86-openssl-0.9.8y.msi。配置:

  1、a、修改D:\Apache2.2\conf\httpd.conf

    b、把ServerRoot這行修改為 ServerRoot "D:\Apache2.2"

    c、把DocumentRoot按照下面的內容修改:

    d、DocumentRoot "D:\Apache2.2\htdocs"

    e、去掉#ServerName www.example.com:80前面的#

    f、<Directory "D:\Apache2.2\htdocs">

    g、尋找DirectoryIndex index.html ,修改為 DirectoryIndex index.html index.php index.htm

    h、尋找ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" ,修改為 ScriptAlias /cgi- bin/ " F:/phptools/Apache2.4/Apache24/cgi-bin" (如果一樣,也不用改)

    i、尋找<Directory "c:/Apache24/cgi-bin"> 修改為 <Directory "F:/phptools/Apache2.4/Apache24/cgi-bin/"> (如果一樣,也不用改)

    j、末尾添加一下幾行,增加對php5的支援:

      # php5 support

      LoadModule php5_module D:\programming\php-5.6.1-Win32-VC11-x64\php5apache2_4.dll

      AddType application/x-httpd-php .php .html .htm

      # configure the path to php.ini

      PHPIniDir "D:\programming\php-5.6.1-Win32-VC11-x64"

小技巧:d:\apache24\bin\httpd.exe -k install, 這句可以把apache添加到系統服務裡去

3、

php環境搭建

聯繫我們

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