xdebug only gets triggered via cli and not browser.
I have a Docker container running apache2 php5 and xdebug. I can only trigger the PHPStorm debugger when I run a php script from the command line on the docker container. The debugger opens and I can step through and see my variables change. I can not see it step through my actual source code though. See post at https://devnet.jetbrains.com/thread/475386?tstart=0 Mapping to file may be a different issue. I have an xdebug log on my server that does show activity when I execute a php script via the root user:

And PHPStorm shows it connecting also:
When I hit my docker container's apache server hello.php with the XDEBUG_SESSION cookie = PHPSTORM I get nothing, no new entries in my xdebug log or my PHPStorm log. The server does return the page. hello.php is a basic hello world page. It does not seem to be triggering xdebug at all. I think I may have some sort of permissions issue. Apache is run under the www-data user while the script is run under root. Below is my xdebug configuration:
xdebug
xdebug support => enabled
Version => 2.4.0beta1
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 => /tmp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_addr_header => no value => no value
xdebug.remote_autostart => On => On
xdebug.remote_connect_back => On => On
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => 192.168.9.12 => localhost
xdebug.remote_log => /xdebug.log => /xdebug.log
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.scream => Off => Off
xdebug.show_error_trace => On => On
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 => /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
Any help in troubleshooting this will be greatly appreciated.
Thanks,
Warren Bell
Please sign in to leave a comment.
Hi there,
How this output was captured? Executed in a CLI .. or phpinfo() output captured via browser?
It needs to be the last one (nice HTML table).
Here you go.
Thanks,
Warren Bell
PHP Version 5.6.14-0+deb8u1
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
Configuration
apache2handler
Apache Environment
HTTP Headers Information
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mhash
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
Phar
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
Additional Modules
Environment
PHP Variables
PHP Credits
PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
1
Thanks.
As suspected -- there is no xdebug here, at all. You have some xdebug variables in environment section .. but no trace of actual xdebug PHP extension (will be xdebug section + mentioning in header table).
Make sure that you are editing correct php.ini file.
That one used by Apache (accordingly to your output is) /etc/php5/apache2/php.ini
I don't see the xdebug configuration when I run phpinfo(), but I do see it when I run php -ini from the command line as root.
Thanks,
Warren
That's fantastic.
Please provide top part of "php -i" output taken in CLI (the equavalent of the above header table)
Bingo, I have been blindly modifing /etc/php5/cli/php.ini . I wondered what that cli in the path meant. I will make the changes and see if I can get it to work.
Thanks,
Warren
That did the trick, I was also able to get the source code to map correctly and I really did not want to turn the debugger on when running php scripts from the cli. So that got fixed also.
Thanks Andriy
Warren