问题描述
我很难使xdebug与PhpStorm一起使用,从日志上看,xdebug可以正常工作,但是PhpStorm出于某种原因没有被忽略.另外,如果我从PHP-> Debug设置菜单中选中"PHP脚本中的第一行中断",则调试器可以工作,但是如果我单击"Resume program [F9]",则调试器会跳过断点,即电话图标(收听PHP")调试连接")
I have problem to make xdebug working with PhpStorm, from log it's looks like that xdebug working fine, but PhpStorm from some reason not oblivious from it.Also, the debugger working if I check "Break at first line in PHP scripts" from PHP->Debug setting menu, but than if I click "Resume program[F9]) it's skip my breakpoint, the telephone icon ("listen for PHP Debug connections")
我认为我正确配置了所有内容,并且还通过了验证检查:
I think I configure everything right and also pass the validation check:
我的20-xdebug.ini:
my 20-xdebug.ini:
zend_extension=xdebug.so
xdebug.var_display_max_data = -1
xdebug.var_display_max_depth = -1
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.remote_mode="jit"
xdebug.profiler_output_dir="root project/laravel-storage/logs/xdebug-profiler.log"
xdebug.remote_log="root project/laravel-storage/logs/xdebug.log"
这是我的配置:
这是一个请求的日志:
Log opened at 2017-10-19 17:24:49
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///home/michael/Pß3V" language="PHP" xdebug:language_version="5.6.31-1~ubuntu16.04.1+deb.sury.org+1" protocol_version="1.0" appid="15877"><engine version="2.5.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright></init>
<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>
<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>
<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>
<- status -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="4" status="starting" reason="ok"></response>
<- step_into -i 5
Log opened at 2017-10-19 17:24:49
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///my project root/server.php" language="PHP" xdebug:language_version="5.6.31-1~ubuntu16.04.1+deb.sury.org+1" protocol_version="1.0" appid="15877" idekey="michael"><engine version="2.5.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright></init>
<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>
<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>
<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>
<- status -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="4" status="starting" reason="ok"></response>
<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file:///my project root/vendor/laravel/framework/src/Illuminate/Foundation/Application.php" lineno="749"></xdebug:message></response>
<- eval -i 6 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="6"><property type="bool"><![CDATA[0]]></property></response>
<- eval -i 7 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="7"><property type="bool"><![CDATA[1]]></property></response>
<- eval -i 8 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="8"><property type="string" size="9" encoding="base64"><![CDATA[bG9jYWxob3N0]]></property></response>
<- eval -i 9 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9QT1JUJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="9"><property type="string" size="4" encoding="base64"><![CDATA[ODAwMA==]]></property></response>
<- eval -i 10 -- KHN0cmluZykoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="10"><property type="string" size="15" encoding="base64"><![CDATA[L2FwaS92YXMtZW5hYmxl]]></property></response>
<- breakpoint_set -i 11 -t line -f file:///my project root/app/controllers/api/APIController_vas.php -n 45
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="11" id="158770017"></response>
<- stack_get -i 12
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="12"><stack where="Illuminate\Foundation\Application->handle" level="0" type="file" filename="file:///my project root/vendor/laravel/framework/src/Illuminate/Foundation/Application.php" lineno="749"></stack><stack where="Asm89\Stack\Cors->handle" level="1" type="file" filename="file:///my project root/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php" lineno="51"></stack><stack where="Illuminate\Session\Middleware->handle" level="2" type="file" filename="file:///my project root/vendor/laravel/framework/src/Illuminate/Session/Middleware.php" lineno="72"></stack><stack where="Illuminate\Cookie\Queue->handle" level="3" type="file" filename="file:///my project root/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php" lineno="47"></stack><stack where="Illuminate\Cookie\Guard->handle" level="4" type="file" filename="file:///my project root/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php" lineno="51"></stack><stack where="Stack\StackedHttpKernel->handle" level="5" type="file" filename="file:///my project root/vendor/stack/builder/src/Stack/StackedHttpKernel.php" lineno="23"></stack><stack where="Illuminate\Foundation\Application->run" level="6" type="file" filename="file:///my project root/vendor/laravel/framework/src/Illuminate/Foundation/Application.php" lineno="641"></stack><stack where="require_once" level="7" type="file" filename="file:///my project root/public/index.php" lineno="48"></stack><stack where="{main}" level="8" type="file" filename="file:///my project root/server.php" lineno="19"></stack></response>
<- run -i 13
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="13" status="stopping" reason="ok"></response>
<- run -i 14
Log closed at 2017-10-19 17:24:49
推荐答案
问题是,尽管cookie仅在想通过浏览器进行调试时才需要(我只需要API调用),但添加cookie可以解决它:
The problem was that I though cookie needed only if wanted to debug via browser (I need only API calls), add cookie solved it:
XDEBUG_SESSION=PHPSTORM; path=/; domain=localhost; Expires=Tue, 19 Jan 2038 03:14:07 GMT;
这篇关于PhpStorm/Xdebug不会在断点处停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!