EdgeCase
EdgeCase

Reputation: 4827

Ubuntu / PHPStorm / Xdebug

I am unable to get xdebug working on PhpStorm under Ubuntu 12.10 and PHP5.4 It appears to me that everything is enabled, but the IDE does not stop at breakpoints. Below are the relevant parameters.

Can someone look at the parameters to see What I am missing? I am wondering if the xdebug.remote_enable needs to be on. I am debugging a local file. The server root and project paths are the same.

If I do need to change PHP54 xdebug parameters, where in the heck do I do that in ubuntu?

I added the following to /etc/php5/apache2/php.ini, restarted apache, but they seem to be ignored.

xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"

php - i output

/etc/php5/cli/conf.d/20-xdebug.ini
xdebug
xdebug support => enabled
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.idekey => no value => no value
xdebug.max_nesting_level => 100 => 100
xdebug.overload_var_dump => On => On
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_output_dir => /tmp => /tmp
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 => Off => Off
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_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /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

Upvotes: 3

Views: 3786

Answers (2)

StalkAlex
StalkAlex

Reputation: 743

Another hint that helped some time ago. I had ubuntu on virtual machine and port 9000 was busy and breakpoints wasn't hit in PhpStorm. So I write this:

xdebug.remote_port=9001

And also same port should be in PhpStorm Debug config. Hope it helps somebody to save time.

Upvotes: 1

Derick
Derick

Reputation: 36794

"php -i" on the command line uses a different php.ini file (/etc/php5/cli/php.ini) than apache does (/etc/php5/apache2/php.ini). Make sure you check phpinfo() through a browser to see whether xdebug.remote_enable has been set. phpinfo() output also tells you which INI files have been loaded, so check there as well.

In general however, for extensions, you want to put configuration files for extensions in /etc/php5/mods-available - in this case, you would create /etc/php5/mods-available/xdebug.ini with just:

xdebug.remote_enable=1

in it. All the other settings should be left untouched (as they are default values anyway).

Upvotes: 5

Related Questions