很多人不知道的是,php框架如thinkphp,laravel等都是可以debug的。
首先需要下载对应的xdebug配置文件,并且在在php.ini
中配置好相关参数
附xdebug配置:
[XDebug]
xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"
xdebug.remote_enable=1
xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"
xdebug.remote_host=app.cn //给框架配置的配置的vhost
zend_extension="D:\phpStudy\php\php-7.1.16-nts\ext\php_xdebug.dll"
xdebug.idekey = "PHPSTORM"
xdebug.profiler_enable_trigger_value=PHPXDEBUG
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable=on
xdebug.remote_connect_back=on
xdebug
等相关的,如果能够用浏览器debug的话,就说明配置好了?XDEBUG_SESSION_START=PHPSTORM
如url?XDEBUG_SESSION_START=PHPSTORM,这个时候就会进入断点。-------------更新phpstorm下cli模式的debug----------------------
php -dxdebug.remote_enable=1 -dxdebug.remote_autostart=on -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 artisan my:command
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。