Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony 3: Debugging with Symfony's development server

During the development on a Symfony 3.3 project I use the Symfony's internal server as seen there But I cannot figure out how to use the xdebug in order to debug it. I mean I have installed and configured xdebug via:

apt-get install php-xdebug

And I export:

export XDEBUG_CONFIG="idekey=phpstorm" 

But when I put a breakpoint to my IDE and I enable the xdebug via that plugin I still get no response.

Also I have put the following settings on /etc/php/7.0/mods-available/xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9021
xdebug.remote_mode=req

And I have configured both PhpStorm to listen over port 9021. But I still get the problem that I cannot make PhpStorm to listen over a breakpoint.

Do you fellows have any sort of idea how I can fix that over my ubuntu-16.04 machine?

Furthermore I have looked on these questions without any success:

  • Xdebug configuration with PHP fastcgi and eclipse?
  • Is it possible to use Xdebug with the built in PHP test server?

EDIT 1

I also tried to export the following:

export XDEBUG_CONFIG="idekey=PHPSTORM"

An configuring the Firefox plugin but still get the very same behaviour. Also keep in mind that I made the PhpStorm to listen over xdebug by pressing the phpstop xdebug button button.

EDIT 2

I also put the following configuration over my PhpStorm:

Php configuration

Still does not work.

like image 745
Dimitrios Desyllas Avatar asked Oct 29 '22 00:10

Dimitrios Desyllas


1 Answers

In the end the following steps are needed:

  1. Put the following content into: /etc/php/7.0/mods-available/xdebug.ini

    zend_extension=xdebug.so
    xdebug.remote_enable=On
    xdebug.remote_handler=dbgp
    xdebug.remote_host=localhost
    xdebug.remote_port=9021
    xdebug.remote_mode=req
    
  2. Export:

    export XDEBUG_CONFIG="idekey=PHPSTORM"
    
  3. Then configure PhpStorm as the image shows.

  4. Set as IDE key PHPSTORM into the Firefox plugin

  5. Enable xdebug on Firefox via pressing the Firefox enable xdebug button button. Alternatively you can append the url with ?XDEBUG_START part

  6. Then press the button disabled xdebug button in PhpStorm. In case you see the PhpStorm enable xdebug](https://i.stack.imgur.com/whuPx.png) button press that until it becomes ![button disabled xdebug then press it back again.

NOTE:

In case you change xdebug settings TERMINATE the xdebug session by pressing PhpStorm enable xdebug button and pressing back again.

Furthermore in case you run composer via terminal disable PhpStorm to listen xdebug by pressing PhpStorm enable xdebug button.

like image 139
Dimitrios Desyllas Avatar answered Nov 15 '22 07:11

Dimitrios Desyllas