參考文章:https://blog.csdn.net/qq_32346189/article/details/81144123 (感謝博主分享)
新版phpstrom中,內置 PHP Remote Debug功能,可以避免 startURL的配置(通過PHP Web Page配置debug模式)。
但是地址欄跟參數XDEBUG_SESSION_START=1,不可去掉。
步驟如下:
一、phpstudy配置並啓用xdebug擴展
phpstudy默認已經安裝了xdebug,但是並沒有默認啓用。先啓用該擴展。然後修改php.ini,內容如下:
[XDebug]
xdebug.profiler_output_dir="E:\software\phpStudy\PHPTutorial\tmp\xdebug"
xdebug.trace_output_dir="E:\software\phpStudy\PHPTutorial\tmp\xdebug"
zend_extension="E:\software\phpStudy\PHPTutorial\php\php-5.6.27-nts\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.trace_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
; //注意這裏是,客戶端的ip和端口<即IDE的機器的ip和端口,不是你的web server>
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9001
xdebug.remote_mode = "req"
xdebug.idekey = PENCEJZ
最後記得重啓phpstudy哦
二、phpstrom配置
1、配置PHP執行程序
注意:此處一定要選擇phpstudy當前運行的php版本