【踩坑】phpstorm+postman+xdebug3 配置
2021-03-17 本文已影响0人
不留余白
xdebug
配置完xdebug死活进不去断点,php --ini 发现有报错信息
Xdebug: [Config] The setting 'xdebug.auto_trace' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.auto_trace (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.collect_params' has been removed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.collect_params (See: https://xdebug.org/docs/errors#CFG-C-REMOVED)
Xdebug: [Config] The setting 'xdebug.collect_vars' has been removed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.collect_vars (See: https://xdebug.org/docs/errors#CFG-C-REMOVED)
Xdebug: [Config] The setting 'xdebug.profiler_enable' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.profiler_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.profiler_enable_trigger' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.profiler_enable_trigger (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_autostart' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_autostart (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_connect_back' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_connect_back (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_enable' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_host' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_log' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_log (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_port' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_port (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
看来是我从网上找的配置是xdebug2的,在3里已经不叫这个名字了,修改配置
xdebug.mode = debug //开启debug
xdebug.client_host = "127.0.0.1"
xdebug.client_port = 9001
xdebug.collect_return=On ;收集返回值
xdebug.idekey="PHPSTORM"
xdebug.log="/tmp/xdebug.log"
世界又美好了...
phpstorm
再看看phpstorm里的配置
(1)在文件->设置->语言与框架中->PHP->debug 设置端口,端口默认为9000,由于经常会被其他程序占用,这里建议设置为9001

(2)在DBGp Proxy中配置你的idekey,idekey就是你在配置文件中最后一项,host是你的服务器ip或者是已经可以解析的域名,port可以自选,一般默认选80就好了

(3)自己手动添加一个,Host填服务器ip,然后port是默认80端口,如果你修改过,你可以更改成你设置的web端口,debug选xdebug

postman
添加cookie XDEBUG_SESSION=PHPSTORM;

