部署網(wǎng)站前查看一下系統(tǒng)是否已經(jīng)安裝CGI
1、啟動(dòng)iis服務(wù)器,打開IIS服務(wù)器
打開IIS服務(wù)器,點(diǎn)擊網(wǎng)站,右擊“添加網(wǎng)站”

2、創(chuàng)建網(wǎng)站
點(diǎn)擊“添加網(wǎng)站”后,進(jìn)入頁(yè)面填寫網(wǎng)站相關(guān)內(nèi)容,如:網(wǎng)站名稱、物理路徑(網(wǎng)站所在文件夾),點(diǎn)擊“確定”創(chuàng)建成功

3、PHP設(shè)置
點(diǎn)擊創(chuàng)建好的網(wǎng)站,點(diǎn)擊“處理程序映射”,點(diǎn)擊右側(cè)的“添加映射模塊”,在彈出層中輸入對(duì)應(yīng)的參數(shù),點(diǎn)擊確認(rèn)


設(shè)置默認(rèn)文檔
點(diǎn)擊“默認(rèn)文檔”,鼠標(biāo)右擊“添加”按鈕,添加默認(rèn)文檔,輸入index.php,點(diǎn)擊“確定”添加



4、安裝urlrewrite
5、使用URL重寫
點(diǎn)擊“URL重寫”,點(diǎn)擊右側(cè)的“導(dǎo)入規(guī)則”,選擇要導(dǎo)入的規(guī)則文件,點(diǎn)擊應(yīng)用即可


應(yīng)用規(guī)則后,網(wǎng)站所在根目錄會(huì)生成一個(gè)web.config文件,我這個(gè)用的是thinkphp的.htaccess文件導(dǎo)入的規(guī)則
文件內(nèi)容:
?xml version="1.0" encoding="UTF-8"?>
configuration>
system.webServer>
rewrite>
rules>
rule name="已導(dǎo)入的規(guī)則 1" stopProcessing="true">
match url="^(.*)$" ignoreCase="false" />
conditions logicalGrouping="MatchAll">
add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
/conditions>
action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
/rule>
/rules>
/rewrite>
handlers>
add name="php-cgi" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="D:\phpStudy\php56n\php-cgi.exe" resourceType="File" />
/handlers>
defaultDocument>
files>
add value="index.php" />
/files>
/defaultDocument>
/system.webServer>
/configuration>
到此這篇關(guān)于IIS服務(wù)器中部署PHP案例詳解的文章就介紹到這了,更多相關(guān)IIS服務(wù)器中部署PHP內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
您可能感興趣的文章:- iis6手工創(chuàng)建網(wǎng)站后無(wú)法運(yùn)行php腳本的解決方法
- 在IIS下安裝PHP擴(kuò)展的方法(超簡(jiǎn)單)
- 阿里云Windows 2008一鍵安裝包配置php web環(huán)境圖文安裝教程(IIS+Php+Mysql)
- PHP+IIS7配置OCI8鏈接Oracle 10G的方法
- Windows2003下php5.4安裝配置教程(IIS)
- windows server 2008/2012安裝php iis7 mysql環(huán)境搭建教程
- IIS7配置PHP5.5 對(duì)找不到的文件啟用文件監(jiān)視的解決方法
- win2008 iis7/iis7.5下最簡(jiǎn)單最強(qiáng)安裝多版本PHP支持環(huán)境