2017-10-19 203 views
0

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

我想我配置的一切权利,并通过验证检查:

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 
+0

将'xdebug.remote_mode'更改为更加标准的'xdebug.remote_mode'。 'jit'更适用于“突破例外”的情况。 – LazyOne

+0

@LazyOne谢谢,我尝试了两种模式,但它们都不适用于我:( – Michael

+0

在哪条线设置了断点?根据我的经验,如果在关联数组的创建中设置断点,则忽略它们。值得添加xdebug_break()而不是设置断点,看看会发生什么 – AdrianBsc

回答

0

的问题是,我虽然饼干仅想通过浏览器来调试需要(我只需要API调用),添加cookie解决了它:

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