欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

Windows2003+IIS7 Express使用FastCgi運行php_PHP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:php 刪除字符串中的空格多種方法
本教程提供了幾款php教程 刪除字符串中的空格多種方法哦,用了php函數(shù),str_replace,trim,正則等替換字符串的空格有效方法 用php自帶的函數(shù) str_replace( , ,$str); 來替換 ?php $str = ##使用函數(shù)trim去掉字符串兩端特定字符####; $str1 = trim($str,#); //為函數(shù)trim

 想在windows 2003中好好跑php,又要節(jié)省內(nèi)存,真是很為難的事情,考慮到IIS7.5 Express可以在WIN2003上跑,不但能以fastcgi的方式支持php,還自帶Rewrite組件,只需簡單改改web.config的rule規(guī)則就可以了。


于是下載了IIS7.5 Express后,安裝,還需要對applicationHost.config進行配置,首先得找到這個文件在哪里,如果能在"我的文檔"中IIS7Express目錄下找到,那就是它了,否則應(yīng)該就是在IIS7 Express的安裝目錄下。

1、先修改:defaultDocument節(jié),加入 <add value="index.php" />
<defaultDocument enabled="true">
<files>
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
<add value="default.aspx" />
<add value="index.php" />
</files>
</defaultDocument>

2、找到fastcgi節(jié)。
<fastCgi>
<application fullPath="C:\php\php-cgi.exe" monitorChangesTo="php.ini" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
<environmentVariable name="PHPRC" value="C:Program Files (x86)iis expressPHPv5.4" />
</environmentVariables>
</application>
</fastCgi>

3、找到handlles,加入
<add name="PHP_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="Either" />
尤其要注意的一是,這一句最好加在最前面,也就是在<handlles>下面的第一句,避免被其它Handle搶先處理了。

以上配置中,C:\php\php-cgi.exe 的部分替換成自己的php文件夾中的php-cgi.exe的位置。

4、在<site>配置節(jié)下,直接修改站點信息,或直接用appcmd.exe add site來添加站點。

5、找到諸如wordpress的安裝文件夾,創(chuàng)建一個web.config文件,在configuration配置節(jié)下,添加Gzip壓縮規(guī)則。
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>

6、同樣在web.config中,Wordpress的rewrite完整的web.config文件內(nèi)容如下:

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
</configuration>

這樣就完全配置完畢了,然后在IIS7 Express目錄下,找到IISExpress.exe,直接雙擊運行,或者用命令行來執(zhí)行指定加載哪個站點. 
iisexpress.exe /site:'站點名稱1"
iisexpress.exe /site:'站點名稱2"
訪問一下,就會發(fā)現(xiàn)訪問速度比在windows下使用apache要快得多,而且少跑一個nginx,內(nèi)存占用整體上也少了很多。

分享:php匹配字符中鏈接地址程序代碼
判斷一個字符串是否含有超級鏈接 下面我們只要過濾連接部份。 正則:/(?=href=)([^]*)(?=)/ (?=exp) 匹配exp后面的位置 (?=exp) 匹配exp前面的位置 此正則 匹配 在 href= 之后 之前 的 非 的所有字符 例子:a href='www.45it.net ' 找到這些字符(url)用 # 替換,就可

來源:模板無憂//所屬分類:PHP教程/更新時間:2013-05-28
相關(guān)PHP教程