0

I'm running PHP 8.1 with Xdebug 3 installed. And I have installed Laravel Valet.

I've tried so many things to make Xdebug work. I want to run it on port 9003 but unfortunately couldn't.

My php.ini Xdebug settings are (as you can see the commented settings that I was trying many things).

[xdebug]
zend_extension=xdebug.so
xdebug.remote_autostart=1
xdebug.default_enable=1
xdebug.remote_port=9003
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM

Below from here are all commented settings:

;xdebug.mode=debug
;xdebug.start_with_request=yes
;xdebug.client_host=localhost
;xdebug.client_port=9003

;zend_extension="xdebug.so"
;xdebug.start_upon_error=1xdebug.client_host=127.0.0.1
;xdebug.client_port=9003
;xdebug.force_display_errors=1
;xdebug.force_error_reporting=1
;xdebug.idekey=PHPSTORM
;xdebug.log=/tmp/xdebug.log
;xdebug.log_level=7
;xdebug.mode=debug
;xdebug.output_dir=/tmp
;xdebug.remote_autostart=1
;xdebug.remote_enable = 1

;zend_extension=xdebug.so
;[xdebug]
;xdebug.remote_enable = 1
;zend_extension=xdebug.so
;xdebug.start_with_request=yes
;xdebug.remote_autostart=1
;xdebug.mode=debug
;xdebug.discover_client_host = true

;zend_extension="xdebug.so"
;xdebug.remote_enable=1
;xdebug.remote_port=9001
;xdebug.remote_handler="dbgp"
;xdebug.remote_host="localhost"
;xdebug.idekey=

;xdebug.remote_enable=on
;xdebug.default_enable=on
;xdebug.remote_autostart=off
;xdebug.remote_port=9001
;xdebug.remote_host=localhost
;xdebug.profiler_enable_trigger=1
;xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R
;xdebug.var_display_max_children = 128
;xdebug.var_display_max_data = 512
;xdebug.var_display_max_depth = 3
;xdebug.remote_enable = 1
;xdebug.idekey = PHPSTORM
;xdebug.show_error_trace = 1
;xdebug.file_link_format = phpstorm://open?%f:%l

These are my PhpStorm settings:

Xdebug is showing

Port settings

Any help please ?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • *"My php.ini Xdebug settings are"* These settings are for Xdebug v2. Xdebug v3 uses different names. Check https://xdebug.org/docs/upgrade_guide first. Then https://www.youtube.com/watch?v=IN6ihpJSFDw and 1) https://www.jetbrains.com/phpstorm/documentation/debugging/ + 2) https://www.jetbrains.com/help/phpstorm/debugging-with-phpstorm-ultimate-guide.html – LazyOne Sep 24 '22 at 15:33
  • I suggest you enable Xdebug log and try to debug -- it will show where it tries to connect to (if it does that at all) and what the response is. Other than that -- I would suggest to find some manual specific for Xdebug + Laravel Valet and follow it. I for example, do not use Valet so cannot suggest any specific comments/ideas, only general ones for Xdebug & PhpStorm. – LazyOne Sep 24 '22 at 15:35

1 Answers1

0

The following config should be enough to get you going with php 8.1 and xdebug 3

zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_port=9003
xdebug.start_with_request=yes
xdebug.log=/tmp/xdebug.log

Also share the path to the .ini where you are keeping the xdebug settings. If you have cli and fpm subfolders under the config path for php 8.1, you would have to make sure both fpm and cli can read the xdebug settings

dbaekajnr
  • 11
  • 3