PhpStorm / Xdebug不会在断点处停下来

时间:2017-10-19 17:39:29

标签: phpstorm xdebug breakpoints

我有问题让xdebug与PhpStorm一起工作,从日志看起来它看起来像xdebug正常工作,但PhpStorm从某种原因并没有忘记它。 此外,调试器工作,如果我检查"在PHP脚本中的第一行中断"从PHP->调试设置菜单,但是如果我点击"恢复程序[F9])它跳过我的断点,电话图标("听PHP调试连接")

我认为我正确配置了一切并通过了验证检查:

enter image description here

我的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"

这是我的配置:

enter image description here enter image description here

enter image description here

enter image description here

这是一个请求的日志:

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-&gt;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-&gt;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-&gt;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-&gt;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-&gt;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-&gt;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-&gt;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

1 个答案:

答案 0 :(得分:0)

问题在于我虽然只需要通过浏览器进行调试就需要cookie(我只需要API调用),添加cookie解决了它:

XDEBUG_SESSION=PHPSTORM; path=/; domain=localhost; Expires=Tue, 19 Jan 2038 03:14:07 GMT;