Skip to main content



      Home
Home » Language IDEs » PHP Development Tools (PDT) » eclipse php debugger not showing variable values withing function blocks(PHP debugging: variable values.)
icon5.gif  eclipse php debugger not showing variable values withing function blocks [message #500121] Tue, 24 November 2009 23:56 Go to next message
Eclipse UserFriend
When I am trying to debug a php web-application it's not showing me the value of the argument variables that's passed to the function. The variable appears as <uninitialized>.

Example:
<?php

$a = 2;
echo "a = " . $a . "<br>";
echo "a*a = " . sqr($a);

function sqr($b) {
	$c=$b;
	echo "c=" . $c . "<br>";
	return $c*$c;
}
?>


when the debugger is inside the function block, it's not showing the value of $c or $b. However it's showing the correct value of $a when on the echo statement on Line 4. Please see screenshot below.

Can anyone help on that. Is this a configuration issue? (I am using xDebug with eclipse)

Thanks!!

http://img686.imageshack.us/img686/9208/12570252.jpg

[Updated on: Thu, 26 November 2009 02:55] by Moderator

Re: eclipse php debugger not showing variable values withing function blocks [message #505940 is a reply to message #500121] Tue, 05 January 2010 10:34 Go to previous messageGo to next message
Eclipse UserFriend
I had the same problem. I think there's a bug in php 5.3 with xdebug, not completely solved.
This is the link of the bug: http://bugs.xdebug.org/view.php?id=376.

My solution was to use PHP 5.2 and installing xdebug using "pecl install xdebug".
It's also important to activate xdebug as a "zend" extention, adding lines like this to php.ini:

zend_extension=/path/to/xdebug/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.show_local_vars=1
xdebug.show_exception_trace=1

This is for Linux, use the proper dll file for Windows.

Hope this helps.
Re: eclipse php debugger not showing variable values withing function blocks [message #505983 is a reply to message #500121] Tue, 05 January 2010 12:37 Go to previous messageGo to next message
Eclipse UserFriend
I had the same problem when trying to debug a PHP 5.3 server until I installed xdebug from svn trunk. The latest release had the problem with variables showing as uninitialized in the debugger, but the latest xdebug development code apparently fixes that. PHP 5.2 did not experience the same problem.
Re: eclipse php debugger not showing variable values withing function blocks [message #505989 is a reply to message #505983] Tue, 05 January 2010 12:57 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for your response.
Can you tell me how to install xdebug from svn trunk? I am using windows and I am not able to compile the code on my computer.
Re: eclipse php debugger not showing variable values withing function blocks [message #506036 is a reply to message #505989] Tue, 05 January 2010 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dkel50.hotremovemail.com

You will need to compile it yourself.

Dave Kelsey

On 05/01/10 17:57, aniss55 wrote:
> Thanks for your response. Can you tell me how to install xdebug from svn
> trunk? I am using windows and I am not able to compile the code on my
> computer.
Re: eclipse php debugger not showing variable values withing function blocks [message #506087 is a reply to message #506036] Tue, 05 January 2010 22:17 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Dave!!
Do you know any free compiler that I can use to compile on windows machine?
Re: eclipse php debugger not showing variable values withing function blocks [message #506114 is a reply to message #506087] Wed, 06 January 2010 04:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dkel50.hotremovemail.com

You can use the microsoft compilers. Check which version you should use
on www.xdebug.org (hopefully there are instructions on how to build it
yourself but I don't know). Microsoft compilers can be found at
msdn.microsoft.com, look for the express edition of C++.

Good luck
Dave Kelsey

On 06/01/10 03:17, aniss55 wrote:
> Thanks Dave!!
> Do you know any free compiler that I can use to compile on windows machine?
Re: eclipse php debugger not showing variable values withing function blocks [message #537331 is a reply to message #505989] Tue, 01 June 2010 23:59 Go to previous messageGo to next message
Eclipse UserFriend
I just installed Xdebug 2.1.0rc1 from xdebug.com and it seems to work great - I now see all variables. The custom installation instructions make it really easy if you're new to linux as I am.

http://xdebug.com/find-binary.php

I'm running
Ubuntu 10.04
PHP Eclipse Gallileo

[Updated on: Wed, 02 June 2010 00:00] by Moderator

Re: eclipse php debugger not showing variable values withing function blocks [message #538019 is a reply to message #537331] Fri, 04 June 2010 10:13 Go to previous message
Eclipse UserFriend
Hi all,

same problem and same solution here. Wink
wish I'd looked here earlier - it was much harder to describe the problem and find answers - than just to recompile xdebug....

Jürgen

Previous Topic:AJAX perspective
Next Topic:PHPEclipse installationw woes
Goto Forum:
  


Current Time: Thu May 22 07:28:27 EDT 2025

Powered by FUDForum. Page generated in 0.04596 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top