看板 PHP 關於我們 聯絡資訊
大家好 php 新手想請教一下如何在 vscode 正確設定執行環境的問題。 我是用 vscode 開發 wordpress 的場景。 為了除錯,我安裝 vscode 的 php debug extensions 並照著該套件的指示安裝 xdebug 。 https://github.com/felixfbecker/vscode-php-debug 開始除錯之後發現請求逾時的時間太短,我根本來不及仔細觀察執行狀況。 從 php 中斷執行之後,大概只要經過 2 ~ 3 分鐘,IIS 就會在網頁上回報 http response code 500,請求逾時了。 為解決這個問題,我已經在 IIS 的站台管理界面設定請求逾時為 3600 秒,然後也在 php.ini 裡面設定 max_execution_time = 3600,最後再重啟站台和電腦,但是請求逾 時的期限好像沒什麼變化。 請問我還需要調整哪裡的設定才能解決這個問題呢? 謝謝大家指教~ 以下附上系統資訊: Windows 7 ver 6.1 SP1 build 7601 IIS 7.5.7600.16385 php 7.2.3-nts-Win32-VC15-x64 php xdebug 套件 2.7.2-7.2-vc15-nts-x86_64 vscode v1.33.1 vscode php debug v1.13 vscode 的 debug 設定 (launch.json): { "version": "0.2.0", "configurations": [ { "name": "Listen for XDebug", "type": "php", "request": "launch", "port": 9000 }, { "name": "Launch currently open script", "type": "php", "request": "launch", "program": "${file}", "cwd": "${fileDirname}", "port": 9000 } ] } wordpress web.config 檔內容: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*"/> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> </conditions><action type="Rewrite" url="index.php"/> </rule> <rule name="WordPress: http://localhost" 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> <defaultDocument> <files> <add value="index.php"/> </files> </defaultDocument> </system.webServer> </configuration> 第一道規則好像是 wordpress 啟動後自己加上去的,但因為系統能動的關係,所以我就 沒去調整了。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.160.103.36 ※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1557736652.A.DFD.html 已解決,原來是我沒有調整 FastCGI 的逾時期限。 似乎不只要調大 FastCGI 的逾時限制,而且還要調大活動逾時的限制, 否則一樣會逾時。 ※ 編輯: dream1124 (118.160.103.36), 05/13/2019 21:28:05