Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xdebug 3 - The setting 'xdebug.remote_***' has been renamed, see the upgrading guide

I just installed Xdebug v3.0.0beta1 on my OSX and tried to use it on PhpStorm 2020.1, but I get this :

Xdebug: [Config] The setting 'xdebug.remote_enable' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED) Xdebug: [Config] The setting 'xdebug.remote_host' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host (See: https://xdebug.org/docs/errors#CFG-C-CHANGED) Xdebug: [Config] The setting 'xdebug.remote_mode' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_mode (See: https://xdebug.org/docs/errors#CFG-C-CHANGED) Xdebug: [Config] The setting 'xdebug.remote_port' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_port

And the links provided lead to nothing but an image with bugs.

My question is what are the right settings to set and where to actually change them since i have nothing about xdebug in my php.ini file.

like image 448
naspy971 Avatar asked Nov 10 '20 20:11

naspy971


People also ask

How do I change my xdebug port?

On the Debug page that opens, specify the following settings in the Xdebug area: In the Debug port field, appoint the port through which the tool will communicate with PhpStorm. By default, Xdebug 2 listens on port 9000. For Xdebug 3, the default port has changed from 9000 to 9003.

Where do I put xdebug in PHP INI?

For Windows, this is normally "c:\xampp\apache\bin\php. ini". Important note for Windows 7 & Vista users: As of August 2013 (XAMPP version 1.8. 2), the file "php_xdebug.


4 Answers

PhpStorm 2020.3 supports XDebug3. There is a detailed upgrade guide on how to change your settings properly.

In my case (using Docker), I had to change the settings

from:

; v2.*

[Xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=off
xdebug.remote_host=host.docker.internal

;# 9000 is default (not required to set).
xdebug.remote_port=9000

to:

; v3.*

[Xdebug]
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal

;# 9003 is now the default (set this for old PhpStorm settings).
xdebug.client_port=9000
like image 132
Alex Slipknot Avatar answered Oct 17 '22 19:10

Alex Slipknot


Xdebug 3 will be supported from PhpStorm 2020.3 version only, which is currently in EAP stage (Early Access Program) and will be released in about 1 month time.

For the moment you will have to either stick to Xdebug 2.9 for your 2020.1 IDE version or try latest 2020.3 EAP build: https://www.jetbrains.com/phpstorm/nextversion/

Xdebug 3 is supported in the most recent EAP #6 build: https://blog.jetbrains.com/phpstorm/2020/11/phpstorm-2020-3-eap-6/


As for the Xdebug 3 upgrade in terms of making changes for Xdebug settings (php.ini) -- check this link: https://xdebug.org/docs/upgrade_guide


You CAN use your 2020.1 PhpStorm with Xdebug 3 if you wish -- just configure Xdebug 3 properly.

It works fine for me with Xdebug 3.0.0beta1, PHP 7.4 x64 on Windows 10 -- see this question: https://stackoverflow.com/a/64820427/783119

Those errors that you see indicate that you still have Xdebug 2 config values in your php.ini.

like image 27
LazyOne Avatar answered Oct 17 '22 17:10

LazyOne


My php -v

PHP 7.2.34-8+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 16:57:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.34-8+ubuntu20.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v3.0.1, Copyright (c) 2002-2020, by Derick Rethans

I got Xdebug v3 working with PHPStorm 2020.2.3 with these steps:

  1. export XDEBUG_SESSION=PHPSTORM

  2. Update php.init file

    xdebug.extension=/usr/lib/php/20200930/xdebug.so <== path to your xdebug.so file
    #xdebug.remote_autostart=1
    xdebug.start_with_request=yes
    #xdebug.remote_connect_back=1
    xdebug.discover_client_host=true
    xdebug.remote_cookie_expire_time = 3600
    #xdebug.remote_enable = 1
    #xdebug.remote_host = localhost
    xdebug.client_host=localhost
    #xdebug.remote_port = 9000
    xdebug.client_port = 9000
    xdebug.remote_handler = dbgp
    xdebug.idekey=PHPSTORM
    xdebug.mode = debug
    

    '#' is old version (Xdebug 2.x)

  3. Reset apache2: sudo service apache2 restart

like image 31
Kevin Black Avatar answered Oct 17 '22 17:10

Kevin Black


In my case I have PHP Storm 2020.2 and haven't changed anything in the IDE side, however, in the server side I have to change a few things

In order to enable Xdebug 3 you need to set xdebug.mode = debug for step debugging

In my particular server config I have set it like this:

  • /etc/php/7.3/cgi/conf.d/20-xdebug.ini

zend_extension=xdebug.so

  • /etc/php/7.3/cgi/conf.d/21-xdebug-mgs.ini

xdebug.mode = debug

Then in my .user.ini in the root of my website I have set this:

[xdebug]
xdebug.client_host = "10.0.0.2"
xdebug.client_port = 9001
xdebug.remote_connect_back = false
xdebug.log = '/var/www/clients/client1/web2/web/j39vm36/administrator/logs/xdebug.log'
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.output_dir = '/var/www/clients/client1/web2/web/j39vm36/administrator/logs/'
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
like image 25
razor7 Avatar answered Oct 17 '22 18:10

razor7