七步教你windows下php5.4安裝

來源:互聯網
上載者:User

1、首先php從5.2中已經修改為FastCGI方式安裝,所以安裝最新版的php5.4需要先安裝fastcgi,fastcgi的如下:

http://www.iisboy.com/iis_down/552.html

         下載後直接運行安裝

2、下載php最新代碼

:http://windows.php.net/download/

下載非安全執行緒的即可,可根據實際需要下載對應的版本

 

3、要想運行php5.4需要vc9的運行庫,如下

http://www.microsoft.com/downloads/zh-cn/details.aspx?displaylang=zh-cn&FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf

 

下載後直接運行安裝

如果不安裝的話會出現如下錯誤:

xp The FastCGI Handler was unable to process therequest

 Error Number:14001

 

4、解壓下載的php-5.4.0-nts-Win32-VC9-x86.zip檔案,並將其放到任意位置如:d:\php5

修改其中的php.ini-development為php.ini

 

5、修改php.ini檔案如下:

; On windows:

 extension_dir ="d:/php5/ext" 

(去掉前面的分號)

 

extension=php_curl.dll

extension=php_gd2.dll

extension=php_gettext.dll

extension=php_mbstring.dll

extension=php_exif.dll    

extension=php_mysql.dll

extension=php_pdo_mysql.dll

extension=php_xmlrpc.dll

extension=php_zip.dll

 

fastcgi.impersonate = 1

 

6、修改fcgiext.ini檔案

         此檔案在安裝第一步後會出現在如下目錄:C:\WINDOWS\system32\inetsrv

在fcgiext.ini檔案的末尾添加如下代碼

         [Types]

php=PHP

[PHP]

ExePath=D:\php5\php-cgi.exe

InstanceMaxRequests=10000

ActivityTimeout=300

RequestTimeout=600

EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:D:\php5\

 

注意:只保留一個[Types] ,其中D:\php5\php-cgi.exe和PHPRC:D:\php5\中的路徑是php的存放路徑,否則出現如下錯誤:

FastCGI Error
The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------
Error Details:
Could not find entry for "php" on site 1 in [Types] section.
Error Number: 1413 (0x80070585).
Error Description: 無效索引。
HTTP Error 500 - Server Error.
Internet Information Services (IIS)
C:\WINDOWS\system32\inetsrv\fcgiext.ini
出現這個錯誤是因為C:\WINDOWS\system32\inetsrv\fcgiext.ini,正確的配置上面已經提到

7、iis設定

前提是已經安裝了iis,設定網站屬性如:

        

運行測試程式碼

<?php phpinfo();?>

如下:證明安裝完畢

 

相關文章

聯繫我們

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