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")
我有问题让xdebug与PhpStorm一起工作,从log看起来xdebug工作得很好,但PhpStorm从某种原因并没有忘记它。此外,调试器工作,如果我从PHP->调试设置菜单检查“PHP脚本中的第一行中断”,但如果我单击“恢复程序[F9]”它跳过我的断点,电话图标(“听PHP调试连接“)
I think I configure everything right and also pass the validation check:
我想我配置一切正确,并通过验证检查:
my 20-xdebug.ini:
我的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"
Here is my configuration:
这是我的配置:
Here is log of one request:
这是一个请求的日志:
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
1 个解决方案
#1
0
The problem was that I though cookie needed only if wanted to debug via browser (I need only API calls), add cookie solved it:
问题是我虽然只需要通过浏览器进行调试就需要cookie(我只需要API调用),添加cookie解决了它:
XDEBUG_SESSION=PHPSTORM; path=/; domain=localhost; Expires=Tue, 19 Jan 2038 03:14:07 GMT;
#1
0
The problem was that I though cookie needed only if wanted to debug via browser (I need only API calls), add cookie solved it:
问题是我虽然只需要通过浏览器进行调试就需要cookie(我只需要API调用),添加cookie解决了它:
XDEBUG_SESSION=PHPSTORM; path=/; domain=localhost; Expires=Tue, 19 Jan 2038 03:14:07 GMT;