首頁  >  文章  >  後端開發  >  iis 2008怎麼安裝php

iis 2008怎麼安裝php

藏色散人
藏色散人原創
2021-10-28 09:19:501530瀏覽

iis 2008安裝php的方法:1、安裝CGI;2、找到管理器,並建立一個新的網站;3、下載php環境安裝包;4、建立並修改php.ini;5、配置iis的「處理應用程式映射」;6、重啟IIS即可。

iis 2008怎麼安裝php

本文操作環境:Windows2008系統、PHP5.6.9版、DELL G3電腦

Win2008 Server設定PHP環境:

在設定PHP環境之前要先設定好IIS。

傳送門-> Win2008 Server下設定安裝IIS

 如果IIS是以預設的設定安裝,則還需要安裝CGI。

在這裡勾選CGI,然後安裝。

建立一個網站

#找到管理器

#刪除預設的網站。 【推薦學習:《PHP影片教學》】

#建立一個新的網站。右鍵點選網站選擇新增網站

網站名稱隨意配置,實體路徑為存放網站的路徑

如果伺服器有綁定域名,在主機名稱那裡配置。

沒有的話預設空就行了。

去網站根目錄隨意加入一個html文檔,然後測試一下

 

配置PHP環境

下載php環境安裝包,選擇自己需要的版本

http://windows.php.net/downloads/releases/archives/

#這裡我下載的是php-5.6.9-nts-Win32-VC11-x86.zip

PHP的兩種執行方式:ISAPI和FastCGI.

nts是Non Thread Safe是非線程安全,這以FastCGI執行方式,他是以單一線程來執行操作,所以不需要進行線程的安全檢查

除去線程安全檢查的防護反而可以提高執行效率,所以,如果是以FastCGI來執行PHP,建議選擇NonThread Safe版本。

反之如果以ISAPI執行方式,則建議選擇Thread Safe版本。

下載好全部解壓縮到自訂目錄

建立一個php.ini,php.ini由php.ini-production改名得到

修改php.ini

搜尋extension_dir,設定路徑,

裡面路徑為自己剛剛解壓縮php的存放路徑加上ext,記住是反斜線前面的分號去掉

#根據需要開啟元件,這裡開啟一些常用的。去掉分號就是開啟了,

以後如果需要什麼就開啟什麼,當然如果嫌麻煩就現在全部開啟。

;extension=php_gd2.dll

;extension=php_curl.dll

;extension=php_mbstring.dll

;extension=php_exif.dll

#;extension=php_mysql.dll

;extension=php_mysqli.dll

;extension=php_scokets.dll

;extension=php_pdo_mysql.dll

##;extension=php_pdo_mysql.dll

##;

## 搜尋date.timezone 設定時區,避免時間亂掉。記得分號去掉

例如:Asia/Chongqing (重慶),Asia/Shanghai (上海),Asia/Urumqi (烏魯木齊),Asia/Macao (澳門),Asia/Hong_Kong (香港),Asia/Taipei (台北),PRC

設定fastcgi.impersonate和cgi.rfc2616_headers

 

#設定cgi.force_redirect = 0  開啟以CGI方式執行PHP

 開啟短標籤支持,############

Configure iis's "Processing Application Mapping"

Add module mapping

Click "Add Module Mapping" on the right to pop up the module mapping settings In the window, enter "*.php" for the name, select "FastCgiModule" for the

module, and select "php-cgi.exe" in the PHP directory you just downloaded and configured to execute the program

Configure default document

Click Add on the right.

Restart IIS.

Add a test document in the root directory of the website and create a new "index.php". The content can be set to

Then test it locally.

PS: The 08 system may lack libraries. Attached is the download address

32-bit Microsoft Visual C Redistributable 2012 download: http://download.microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x86.exe
64-bit Microsoft Visual C Redistributable 2012 Download: http://download .microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x64.exe

以上是iis 2008怎麼安裝php的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn