1

I installed Xdebug and checked with phpinfo().

I tried debugging public/index.php with "Launch currently open script" option and it worked fine.

Defining a route for testing, a controller, I started the "Listen for Xdebug" option, and then, I went to that url in my browser. But nothing happens at the preselected breakpoint.

launch.json

    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "log": true
        },

xdebug.ini

zend_extension=xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9003
  • PHP 7.2
  • Laravel 5.6
  • Ubuntu 20.04
  • Xdebug 3.1.2
1
  • 1
    Seems like you're using an old configuration. Check xdebug.org/docs/upgrade_guide on how to upgrade the options Commented May 10, 2022 at 6:10

1 Answer 1

3

You are using Xdebug 3.1.2. but all your settings are still for Xdebug 2. There is a handy upgrade guide that you most definitely should read. To replicate the Xdebug 2 settings from above with Xdebug 3 settings, use:

zend_extension=xdebug.so

xdebug.start_with_request=yes
;xdebug.remote_autostart = 1

xdebug.mode=develop,debug
;xdebug.remote_enable = 1

; This one has been removed:
;xdebug.remote_handler = dbgp

; These are defaults, so you don't need to set them. They aso have been renamed:
;xdebug.remote_host = 127.0.0.1
;xdebug.remote_port = 9003
;xdebug.remote_mode = req

xdebug.log=/tmp/xdebug_remote.log
;xdebug.remote_log = /tmp/xdebug_remote.log

Or in short:

zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.log=/tmp/xdebug_remote.log
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.