Debugging Symfony2 with XDebug and PHPStorm

I am trying to try, but I cannot get the correct debug configuration for Symfony2 with XDebug in PHPStorm.

I already checked and double-checked

and followed the textbooks on bargaining chips, but could not do the job.

This is a priori with Symfony2 that I am trying to debug. So far I have a virtual host with Apache2 that works fine in the URL

host: sd.lo

Routing Prefix for api -

/api/v1

therefore access to

http://sd.lo/api/v1/clients

working fine and i get a list of clients

Installation

XDebug installed correctly, as shown in my phpinfo (), and using the command

In my / usr / local / etc / php / 5.5 / conf.d / ext-xdebug.ini (which is loaded correctly) I have:

[xdebug]
zend_extension="/usr/local/Cellar/php55-xdebug/2.3.3/xdebug.so"
xdebug.profiler_output_dir="/tmp/xdebug/"
xdebug.profiler_enable=on
xdebug.remote_enable=on
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.idekey = PHPSTORM

And with the command

/usr/local/Cellar/php55/5.5.28/bin/php -v

PHP 5.5.28 (cli) (built: Aug 13 2015 14:02:41) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans

PHPStorm

PHP PHPStorm ( OSX PHP. Brew - , ), :

Path executable: /usr/local/Cellar/php55/5.5.28/bin/php
Debugger: XDebug 2.3.3 so is correct

PHPStorm > PHP >

Name: Project.com
Host: sd.lo (root for my Virtual Host)
Port: 80
Debugger: XDebug
Use path mappings: UNCHECKED as I believe Symfony2 Plugin makes this for me

Debug PHP

Name: ApiBundle
Server: Project.com (which host was sd.lo)
Ide Key: PHPSTORM

Chrome

  • XDebug Helper PHPStorm IDE Key
  • cookie cookie XDEBUG_SESSION = PHPSTORM

  • .
  • PHPStorm, : PHP
  • , : ide: PHPSTORM

:

  • xdebug.remote_host = "localhost", ?

  • PHP- URL-?

  • ? Symfony?

Run > Break PHP- ​​ , script app_dev.php: 13, .

- ?

Edit

phpinfo() xdebug

xdebug support  enabled
Version 2.3.3
IDE Key PHPSTORM

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $

Directive   Local Value Master Value
xdebug.auto_trace   Off Off
xdebug.cli_color    0   0
xdebug.collect_assignments  Off Off
xdebug.collect_includes On  On
xdebug.collect_params   0   0
xdebug.collect_return   Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable  On  On
xdebug.default_enable   On  On
xdebug.dump.COOKIE  no value    no value
xdebug.dump.ENV no value    no value
xdebug.dump.FILES   no value    no value
xdebug.dump.GET no value    no value
xdebug.dump.POST    no value    no value
xdebug.dump.REQUEST no value    no value
xdebug.dump.SERVER  no value    no value
xdebug.dump.SESSION no value    no value
xdebug.dump_globals On  On
xdebug.dump_once    On  On
xdebug.dump_undefined   Off Off
xdebug.extended_info    On  On
xdebug.file_link_format no value    no value
xdebug.force_display_errors Off Off
xdebug.force_error_reporting    0   0
xdebug.halt_level   0   0
xdebug.idekey   PHPSTORM    PHPSTORM
xdebug.max_nesting_level    256 256
xdebug.max_stack_frames -1  -1
xdebug.overload_var_dump    On  On
xdebug.profiler_aggregate   Off Off
xdebug.profiler_append  Off Off
xdebug.profiler_enable  On  On
xdebug.profiler_enable_trigger  Off Off
xdebug.profiler_enable_trigger_value    no value    no value
xdebug.profiler_output_dir  /tmp/xdebug/    /tmp/xdebug/
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back  Off Off
xdebug.remote_cookie_expire_time    3600    3600
xdebug.remote_enable    On  On
xdebug.remote_handler   dbgp    dbgp
xdebug.remote_host  localhost   localhost
xdebug.remote_log   no value    no value
xdebug.remote_mode  req req
xdebug.remote_port  9000    9000
xdebug.scream   Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars  Off Off
xdebug.show_mem_delta   Off Off
xdebug.trace_enable_trigger Off Off
xdebug.trace_enable_trigger_value   no value    no value
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir /var/tmp/   /var/tmp/
xdebug.trace_output_name    trace.%c    trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth    3   3

no/tmp/xdebug : S

+4

Source: https://habr.com/ru/post/1609093/


All Articles