[已解決] 設定 vscode php debug 逾時期限的方法?

作者: dream1124 (全新開始)   2019-05-13 16:37:29
大家好
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 啟動後自己加上去的,但因為系統能動的關係,所以我就
沒去調整了。

Links booklink

Contact Us: admin [ a t ] ucptt.com