看看在IIS上部署PHP網(wǎng)站的方法

看看在IIS上部署PHP網(wǎng)站的方法

推薦(免費(fèi)):IIS

1、啟動(dòng)iis服務(wù)器,打開iis服務(wù)器

打開IIS服務(wù)器,點(diǎn)擊網(wǎng)站,右擊“添加網(wǎng)站”

看看在IIS上部署PHP網(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)建成功

立即學(xué)習(xí)PHP免費(fèi)學(xué)習(xí)筆記(深入)”;

看看在IIS上部署PHP網(wǎng)站的方法

3、php設(shè)置

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

看看在IIS上部署PHP網(wǎng)站的方法

看看在IIS上部署PHP網(wǎng)站的方法

設(shè)置默認(rèn)文檔

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

看看在IIS上部署PHP網(wǎng)站的方法

看看在IIS上部署PHP網(wǎng)站的方法

看看在IIS上部署PHP網(wǎng)站的方法

4、安裝urlrewrite

5、使用URL重寫

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

看看在IIS上部署PHP網(wǎng)站的方法看看在IIS上部署PHP網(wǎ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> ?????????????????????<match></match> ?????????????????????<conditions> ?????????????????????????<add></add> ?????????????????????????<add></add> ?????????????????????</conditions> ?????????????????????<action></action> ?????????????????</rule> ?????????????</rules> ?????????</rewrite> ?????????<handlers> ?????????????<add></add> ?????????</handlers> ?????????<defaultdocument> ?????????????<files> ?????????????????<add></add> ?????????????</files> ?????????</defaultdocument> ?????</system.webserver> ?</configuration>

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊11 分享