Adelin
Adelin

Reputation: 19011

Why IntelliJ IDEA doesn't not stop at breakpoints when using PHP and Xdebug?

Thanks for taking the time to read through my post. I am trying to debug a Laravel application in IntelliJ Idea. I've configured everything required. Using Visual Studio Code I was able to break on a point, read variables, and such. However, IntelliJ Idea doesn't seem to work and stop on a point. The following are all my configurations:

1. Out put from php --version to that Xdebug is configured.

PHP 8.0.5 (cli) (built: Apr 29 2021 15:56:40) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.5, Copyright (c) Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
    with Zend OPcache v8.0.5, Copyright (c), by Zend Technologie

2. php.ini Xdebug configurations:

[xdebug]
zend_extension="/usr/local/lib/php/pecl/20200930/xdebug.so"
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.log = "/Users/my-name/php-debug/xdebug.log"

3. Screenshot to show that Xdebug Extension is installed in Chrome. enter image description here

4. IntelliJ IDEA Configurations: enter image description here

enter image description here

enter image description here enter image description here

5. I tried to troubleshoot Xdebug by using a log file here are the logs when I call http://localhost:8888 in my browser.

[70764] Log opened at 2021-05-09 11:21:43.753573
[70764] [Step Debug] INFO: Connecting to configured address/port: 127.0.0.1:9003.
[70764] [Step Debug] INFO: Connected to debugging client: 127.0.0.1:9003 (through xdebug.client_host/xdebug.client_port). :-)
[70764] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///Users/aghan/workspace/learn-laravel/syara-ps/index.php" language="PHP" xdebug:language_version="8.0.5" protocol_version="1.0" appid="70764" idekey="PHPSTORM"><engine version="3.0.4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2021 by Derick Rethans]]></copyright></init>
[70764] [Step Debug] <- feature_set -i 1 -n show_hidden -v 1
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>
[70764] [Step Debug] <- feature_set -i 2 -n max_depth -v 1
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>
[70764] [Step Debug] <- feature_set -i 3 -n max_children -v 100
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>
[70764] [Step Debug] <- feature_set -i 4 -n extended_properties -v 1
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="extended_properties" success="1"></response>
[70764] [Step Debug] <- feature_set -i 5 -n notify_ok -v 1
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="notify_ok" success="1"></response>
[70764] [Step Debug] <- feature_set -i 6 -n resolved_breakpoints -v 1
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="6" feature="resolved_breakpoints" success="1"></response>
[70764] [Step Debug] <- stdout -i 7 -c 1
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="7" success="1"></response>
[70764] [Step Debug] <- status -i 8
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="8" status="starting" reason="ok"></response>
[70764] [Step Debug] <- step_into -i 9
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="9" status="break" reason="ok"><xdebug:message filename="file:///Users/aghan/workspace/learn-laravel/syara-ps/index.php" lineno="2"></xdebug:message></response>
[70764] [Step Debug] <- eval -i 10 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="10"><property type="bool"><![CDATA[0]]></property></response>
[70764] [Step Debug] <- eval -i 11 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="h
[70764] [Step Debug] <- eval -i 12 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="12"><property type="string" size="9" encoding="base64"><![CDATA[bG9jYWxob3N0]]></property></response>
[70764] [Step Debug] <- eval -i 13 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9QT1JUJ10p
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13"><property type="string" size="4" encoding="base64"><![CDATA[ODg4OA==]]></property></response>
[70764] [Step Debug] <- eval -i 14 -- KHN0cmluZykoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10p
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="14"><property type="string" size="1" encoding="base64"><![CDATA[Lw==]]></property></response>
[70764] [Step Debug] <- detach -i 15
[70764] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="15" status="stopping" reason="ok"></response>
[70764] Log closed at 2021-05-09 11:21:43.771518

6. Logging from IntelliJ by using com.jetbrains.php.debug (as described here)

2021-05-09 15:12:29,804 [49179217]  DEBUG - .connection.PhpDebugConnection - 1588338947#----connection started 
2021-05-09 15:12:29,812 [49179225]  DEBUG - .connection.PhpDebugConnection - 1588338947#---Start detaching 
2021-05-09 15:12:29,813 [49179226]  DEBUG - .connection.PhpDebugConnection - 1588338947#---stop reading 
2021-05-09 15:12:29,813 [49179226]  DEBUG - .connection.PhpDebugConnection - 1588338947#---stop writing 
2021-05-09 15:12:29,813 [49179226]  DEBUG - .connection.PhpDebugConnection - 1588338947#----connection stopped 
2021-05-09 15:12:29,813 [49179226]  DEBUG - .connection.PhpDebugConnection - 1588338947#---Stop detaching 

Upvotes: 0

Views: 895

Answers (1)

Adelin
Adelin

Reputation: 19011

Ok, the problem was that in "ignore external connections through ..." this tick should not be selected. as in the picture bellow.

enter image description here

Upvotes: 3

Related Questions