2017-10-19 154 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;