phpstudy+phpstorm xdebug配置

记录下自己配置xdebug中遇到的一些坑:

php.ini中的坑:

xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.remote_enable = 1
xdebug.remote_host = "127.0.0.1"
xdebug.remote_handler = dbgp
xdebug.remote_port = 9100
xdebug.idekey = PHPSTORM
xdebug.profiler_output_dir="E:\gang\phpstudy\PHPTutorial\tmp\xdebug"
xdebug.trace_output_dir="E:\gang\phpstudy\PHPTutorial\tmp\xdebug"
zend_extension="E:\gang\phpstudy\PHPTutorial\php\php-7.0.12-nts\ext\php_xdebug.dll"  ##注意这里,默认是;zend_extension注释的,需要去掉分号

在配置过程中还有一些坑的地方:

    1.我修改配置是用的是text修改的,但是打印phpinfo时,会发现xdebug配置部分中会出现乱码,导致xdebug始终无法配置成功,后来用sublime编辑才发现确实有乱码,可能是tab换行或者空格导致的,所以,开启xdebug配置后最好看下phpinfo()中的配置是否正常;

phpstorm配置中的坑:

注意这里的host配置,不要配成http://***,***/(这里斜杆也是多余的)

Postman如果需要debug:需要在header中加入key:cookie,value:XDEBUG_SESSION=PHPSTORM

猜你喜欢

转载自blog.csdn.net/a18827547638/article/details/88687415