Apache+PHP5運(yùn)行時(shí)出現(xiàn)mod_fcgid出現(xiàn)500錯(cuò)誤的解決方法
[重要通告]如您遇疑難雜癥,本站支持知識(shí)付費(fèi)業(yè)務(wù),掃右邊二維碼加博主微信,可節(jié)省您寶貴時(shí)間哦!
前臺(tái)有朋友安裝了Apache+PHP5+MYSQL5,想多版本一起運(yùn)行,同時(shí)運(yùn)行PHP5.2/5.3/5.4然后都設(shè)置好了后出現(xiàn)
Please contact the server administrator
查看日志如下:
==============================================================
[Wed Nov 30 15:20:57 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 15:20:57 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 15:24:17 2016] [error] [client 222.129.236.32] File does not exist: D:/wwwroot/ttwhzg/web/favicon.ico
[Wed Nov 30 15:24:19 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 15:24:19 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 15:24:22 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 15:24:22 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 15:24:23 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 15:24:23 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 15:24:24 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 15:24:24 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 15:24:25 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 15:24:25 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 15:24:28 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 15:24:28 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 17:35:18 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
[Wed Nov 30 17:35:18 2016] [error] [client 222.129.236.32] Premature end of script headers: tz.php
[Wed Nov 30 17:35:21 2016] [warn] [client 222.129.236.32] (OS 109)管道已結(jié)束。 : mod_fcgid: get overlap result error
================================================================
根據(jù)搜索引擎找了一些相關(guān)的資料,也很模糊;
第一類錯(cuò)誤是腳本執(zhí)行被中斷,沒有返回完整的http header;第二類錯(cuò)誤是cgi程序的執(zhí)行被強(qiáng)行中止。
根本原因是fastcgi會(huì)自動(dòng)kill掉一些發(fā)呆的、長時(shí)間沒有響應(yīng)的進(jìn)程(要不它比較快,比較省內(nèi)存?。?,
但是fastcgi的默認(rèn)idle時(shí)間設(shè)置過于苛刻(官方文檔中每個(gè)選項(xiàng)都有默認(rèn)的時(shí)間值),
所以有些處理比較慢、需要調(diào)用外部資源的程序就有可能被誤殺,所以先略微調(diào)整一下,繼續(xù)觀察:
<IfModule mod_fcgid.c>
IdleTimeout 600
ProcessLifeTime 3600
MaxProcessCount 8
DefaultMinClassProcessCount 3
DefaultMaxClassProcessCount 3
IPCConnectTimeout 30
IPCCommTimeout 600
#MaxRequestsPerProcess 500
</IfModule>
- IdleTimeout 發(fā)呆時(shí)限
- ProcessLifeTime 一個(gè)進(jìn)程的最長生命周期,過期之后無條件kill
- MaxProcessCount 最大進(jìn)程個(gè)數(shù)
- DefaultMinClassProcessCount 每個(gè)程序啟動(dòng)的最小進(jìn)程個(gè)數(shù)
- DefaultMaxClassProcessCount 每個(gè)程序啟動(dòng)的最大進(jìn)程個(gè)數(shù)
- IPCConnectTimeout 程序響應(yīng)超時(shí)時(shí)間
- IPCCommTimeout 與程序通訊的最長時(shí)間,上面的錯(cuò)誤有可能就是這個(gè)值設(shè)置過小造成的
- MaxRequestsPerProcess 每個(gè)進(jìn)程最多完成處理個(gè)數(shù),達(dá)成后自殺,因?yàn)镻HP最多只處理500次請(qǐng)求。
上述選項(xiàng)的確切作用我也不是十分清楚,先用著這個(gè)設(shè)置,再根據(jù)情況調(diào)整。
問題未解決?付費(fèi)解決問題加Q或微信 2589053300 (即Q號(hào)又微信號(hào))右上方掃一掃可加博主微信
所寫所說,是心之所感,思之所悟,行之所得;文當(dāng)無敷衍,落筆求簡潔。 以所舍,求所獲;有所依,方所成!