参考文章: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版本