David | 13 Mar 13:15 2012
Picon

How to debug php code run with exec()

Hi,

I'm trying to debug php code launched from a php "launcher" script with a exec() call. I'm being able to debug the "launcher" php code with vim + xdebug plugin, but I cannot debug any line of the php code executed with that exec() call.


Is there any way to do it? The XDEBUG_CONFIG environment variable is correctly set before the call to exec(). Also, launching the php code with something like exec("export XDEBUG_CONFIG="whatever"; cmd php PhpCodeICannotDebug.php") does not work either.


Regards,
David
dendixon | 12 Mar 22:22 2012

SOLVED-installing xdebug-2.1.3

SOLVED - Solution was simple (as always):

The directory to run the command is :
/opt/xdebug-2.1.3/xdebug-2.1.3

NOT: /opt/xdebug-2.1.3
I was in a directory one level too high.

Sorry for bothering you with this question.

**********
Trying to run inside the directory "xdebug-2.1.3" the command:
sudo /opt/lampp/bin/phpize-5.3.8
for lampp 1.7.7

I got the error message:
Cannot find config.m4.
Make sure that you run '/opt/lampp/bin/phpize-5.3.8' in the top level
source directory of the module

I thought I had done the very same thing when installing xdebug on lampp
1.7.2 but maybe not.

Any ideas on why phpize can't find config.m4?
Thanks for any help.

-- 
Dennis Dixon
http://www.mendocinoconnection.com

--

-- 
Dennis Dixon
http://www.mendocinoconnection.com

dendixon | 11 Mar 20:15 2012

installing xdebug-2.1.3

Trying to run inside the directory "xdebug-2.1.3" the command:
sudo /opt/lampp/bin/phpize-5.3.8
for lampp 1.7.7

I got the error message:
Cannot find config.m4.
Make sure that you run '/opt/lampp/bin/phpize-5.3.8' in the top level
source directory of the module

I thought I had done the very same thing when installing xdebug on lampp
1.7.2 but maybe not.

Any ideas on why phpize can't find config.m4?
Thanks for any help.

--

-- 
Dennis Dixon
http://www.mendocinoconnection.com

gary mazzaferro | 15 Feb 08:37 2012

[RESOLVED] (almost) Re: appears installed and enabled,but doesn't seem to work

FIXED: except for logging

It was SeLinux interfering with xdebug.
For a development machine the easiest fix is disabling SeLinux

In file ”/etc/selinux/config”:

SELINUX=disabled
reboot and it should work.
I wasn't able to get the xdebug.log file to update from the apache server.
If you need SeLinux enable like I do, the issue is more complex Use the "setsebool -P httpd_can_network_connect 1"
and it should work.

If you need file writing turned on, its more complicated.

UPDATE THE DOCUMENTATION !!! please.

cheers
On Tue, Feb 14, 2012 at 9:17 PM, gary mazzaferro <garym <at> oedata.com> wrote:
One more update; 

I tried setting the idekey in the environment and executing a php script from the command line. 
Both, the debugclient and netbeans was able to capture the debug.

The problem is the php scripts on the apache 2.2 server are not launching the remote.

I even placed the 'xdebug.idekey=netbeans-xdebug' in php.ini file without positive result.
I also used the "Easy xdebug" plugin on fire fix without positive result.

Any help ?? 


On Tue, Feb 14, 2012 at 11:03 AM, gary mazzaferro <garym <at> oedata.com> wrote:

On Tue, Feb 14, 2012 at 7:34 AM, gary mazzaferro <garym <at> oedata.com> wrote:
Hi,

I installed xdebug, but can't seem to make it work. I have a simple hello.php file in Documentroot with a syntax error and the remote xdebug wil not launch. I tried with netbeans and the debugclient, without success.

Additionally, the is no log file created.

How can I get xdebug to launch ?

b/r
-g

This is a quick update:

I uninstalled php and xdebug, reinstalled the stack and now I get the stack trace in the browser.

The remote still as dead as ever. I also disabled the firewall, just in case.

 

Distribution; Centos 6.2

OS:
Linux localhost.localdomain 2.6.32-220.4.1.el6.x86_64 #1 SMP Tue Jan 24 02:13:44 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux

This is the URL:
http://localhost/hello.php?XDEBUG_SESSION_START=netbeans-xdebug

This is the version info:
PHP 5.3.3 (cli) (built: Feb  2 2012 23:47:49)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans

This is the configuration from PHPInfo:
xdebug

xdebug support => enabled
Version => 2.1.3

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

Directive => Local Value => Master Value
xdebug.auto_trace => Off => Off
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.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 => garym => no value
xdebug.manual_url => http://www.php.net => http://www.php.net
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 => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log
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_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





gary mazzaferro | 14 Feb 15:34 2012

appears installed and enabled,but doesn't seem to work

Hi,

I installed xdebug, but can't seem to make it work. I have a simple hello.php file in Documentroot with a syntax error and the remote xdebug wil not launch. I tried with netbeans and the debugclient, without success.

Additionally, the is no log file created.

How can I get xdebug to launch ?

b/r
-g

Distribution; Centos 6.2

OS:
Linux localhost.localdomain 2.6.32-220.4.1.el6.x86_64 #1 SMP Tue Jan 24 02:13:44 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux

This is the URL:
http://localhost/hello.php?XDEBUG_SESSION_START=netbeans-xdebug

This is the version info:
PHP 5.3.3 (cli) (built: Feb  2 2012 23:47:49)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans

This is the configuration from PHPInfo:
xdebug

xdebug support => enabled
Version => 2.1.3

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

Directive => Local Value => Master Value
xdebug.auto_trace => Off => Off
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.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 => garym => no value
xdebug.manual_url => http://www.php.net => http://www.php.net
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 => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log
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_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


nhoeller | 14 Feb 04:41 2012
Picon

xdebug.trace_format Does Not Change cachegrind.out.nnnn Format

I installed xdebug 2.1.3 on a CentOS 5 system running PHP 5.2.13 and Apache 2.2.3.  I updated php.ini with the following, appended XDEBUG_PROFILE=1 to a Drupal URL and was able to get a function trace.

zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "/tmp"

I then set xdebug.profiler_enable_trigger = 1, add the following lines and restarted Apache.  However, the format of the output file looks identical to what I had before.  Setting xdebug.profiler_enable_trigger = 2 made no difference.  I verified that the values are being picked up using phpinfo(),

xdebug.collect_params = 4
xdebug.collect_return = 1

Am I missing something obvious?
     Thanks, Norbert
Manmohan Sethi | 13 Feb 09:22 2012
Picon

Not able to get the xdebug working

Hi,

I am a novice in the Open source world and was looking for a PHP debugger. I got xdebug. I downloaded the xdebuf veriosn 2.1.3 and installed it on Ubuntu 10.04, PHP version 5.2.3. . The Xdebug information is appearing in phpinfo. php5 -m is also showing xdebug under the Zend module. I have made the following entries in php.ini files at two different locations:

zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_log = /home/abc/xdebug_logs/xdebug.log

I am using Netbeans 7.1 for PHP to dubug my PHP projects. I have already done the port and other setting for the xdebug in Netbeans, still the Netbeans is not able to connections to the xdebug.I also tried the command:

mac <at> mac-desktop:/$debugclient

But it is showing the following result:

mac <at> mac-desktop:/$ debugclient
Xdebug Simple DBGp client (0.10.0)
Copyright 2002-2007 by Derick Rethans.
- libedit support: enabled
bind: couldn't bind AF_INET socket?

I tried googling around and found that this is normal behavior. The debugclient will retry every 5 seconds until the OS frees 
it. This is normal behavior. However, I didn't find any solution about how I can remove this error and make connection to the xdebug server via Netbeans or even via debugclient command.
Any help would be highly appreciated. 

-- 
Thanks

Manmohan

“Your attitude, not your aptitude, will determine your altitude”
Taavi Burns | 9 Feb 20:39 2012
Picon

Use a flat array for line coverage. (take 2)

I revisited the line coverage data structure refactoring I did in the
summer. It still looks like a fairly easy 4% win in overall
performance when running PHPUnit's own test suite (with coverage).

https://github.com/derickr/xdebug/pull/15

Thanks for accepting my other patches! I didn't see any comments on
this particular bit, so I have no idea if it just lay forgotten or if
it's not stylistically correct or… Just wondering if there's anything
else I can do to help get this (or something like it) merged in (or
knowing that it's not interesting to the project as a whole).

Have a great day!

--

-- 
taa
/*eof*/

Nicholas Foynes | 3 Feb 16:42 2012
Picon

404 on dll file

Hi,

I'm working with php 5.2.9 and I've analysed my php.ini file with the tailored instructions page. I always get following link: http://xdebug.org/files/php_xdebug-2.1.3-5.2-vc6.dll
When i try to download this file i get a 404 the file doesn't exist.
Is this file missing or is there something wrong with the analyser?
Thanks for putting so much time in xdebug!


--

Met vriendelijke groeten,
Nicholas Foynes


indiegroup
interactive digital experience
engelse wandeling 2 k18
b8500 kortrijk
T +32 (0)56/36 21 90

www.indiegroup.be
www.facebook.com/indiegroup.be
www.twitter.com/indie_group

 


Ben Waine | 1 Feb 12:03 2012
Picon

Xdebug CLI debugging on a shared development server.

Hello,


I'm having difficulty setting up command line debugging on a shared development environment. I've had this working in the past but this setup is slightly different. 

I have a windows XP client running Netbeans and a shared development host running centos. Normal debugging of web pages is working fine and I can trigger debugging sessions in the usual way by passing a cookie in the request. 

I'm trying to set up CLI debugging so I can debug my unit tests. PHPUnit is used on the remote host not the client. 

Steps to achieve this: 

1) Open a debugging session on the client. 
2) Client shows 'waiting for connection' as usual. 
3) Open SSH session with host.
4) Check value of $SSH_CLIENT - for use later.
5) Export environment variable as described in the docs: export XDEBUG_CONFIG="idekey=netbeans-xdebug, xdebug.remote_host=10.132.221.79"
6) Trigger PHPUnit
7) Expect connection with client at this point. 

The PHPUnit tests run as normal but xdebug does not connect to the remote client. I've also tried the XDebugClient and can't achieve a connection here. 

php -i | grep xdebug indicated remote connect back is on. 

My questions:

Is remote connect back the cause of my problem? Is it overriding xdebug.remote_host? It isn't listed as something I can change in the environment variable. 
Am I setting the environment variable correctly?
Any additional steps required to configure host or client I'm not aware of?

The joys of a shared development environment! 

Thanks,

Ben

Alfio Dopudi | 31 Jan 17:11 2012
Picon

404 - Not Found - php_xdebug-2.1.3-5.3-vc6.dll

Hi,

I have run my Phpinfo() through the tailored installation form and the output tells me to download the following file php_xdebug-2.1.3-5.3-vc6.dll but there is no such file in http://xdebug.org/files directory.

What other file can I use to update a 32-bit XAMPP stack?

Thanks,


Alfio


Gmane