Working zero config php xdebug 3.1.1 and phpStorm 2021.3 RC

php 7.4 w/xdebug 3.0

phpStorm 2020.3

zend_extension=”xdebug.so”
xdebug.mode=debug;
xdebug.file_link_format=”http://localhost:63342/api/file/%f:%l”

This now makes xdebug output links that open phpstorm (which is actively listening on port 63342… phpstorm:// wasn’t working for me anymore…

[UPDATE 2021-01-14]
zend_extension="xdebug.so"
xdebug.mode=debug;
xdebug.file_link_format="phpstorm://open?file=%f&line=%l

phpStorm 2020.3.1
php 8.0.1
xdebug 3.0.1

[UPDATE 2021-11-29]

Seems like phpstorm/intelliJ have changed the mechanism, and phpstorm:// protocol no longer works.

After much troubleshooting I have it working, but for projects that use a framework, such as Symfony.

You will now need to utilize the framework.yml ide field,

https://symfony.com/doc/current/reference/configuration/framework.html#ide

and enter it as follows:

  • phostorm 2021.3 RC
  • PHP 8.1.0
  • xdebug 3.1.1
  1. Comment out the xdebug.file_link_format, as that no longer works…
  2. edit: /config/packages/framework.yaml
framework:
    ide: 'jetbrains://php-storm/navigate/reference?project=%env(resolve:PROJECT_NAME)%&path=%%f:%%l'

3. edit: /.env ensure that this matches your project name… otherwise jetbrains won’t be able to find the correct session/window.

PROJECT_NAME="the name of the project"

4. clear cache, and now your links should work.

5. restart apache/nginx if required.

Now your Symfony project will allow you to edit your files again.

[Update: 2023-07-12]

No need for PROJECT_NAME again, or the edit to the framework.yaml file
1. edit your php.ini file, (or xdebug.ini), to include the line

xdebug.file_link_format="phpstorm://open?file=%f&line=%l"

2. restart apache/nginx/php-fpm if required.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *