Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Xdebug 2.2.2: no call stack in browser

General discussions related to php

Moderators: macek, egami, gesf

Xdebug 2.2.2: no call stack in browser

Postby vruiz » Fri Apr 12, 2013 10:25 am

I'm new to Xdebug. I've installed from source version 2.2.2 in linux and followed instructions from http://xdebug.org/docs/install to configure it. I can use debugclient and connect to server and issue commands. I can see Xdebug is present in Zend Engine v2.4.0 and enabled as extension with info.php output. When I request a recursive function to overpass xdebug.max_nesting_level=100 to throw an error there is no call stack in the browser. This are some vars I configured in php.ini:
zend_extension=/usr/lib/php5/extensions/xdebug.so
xdebug.remote_enable=On
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.dump.SERVER=*
xdebug.dump.ENV=*
xdebug.dump.REQUEST=*
xdebug.scream=1
xdebug.default_enable=1
xdebug.dump_undefined=1
xdebug.auto_trace=On

What am I missing that makes no call stack output?
vruiz
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Apr 12, 2013 9:49 am

Re: Xdebug 2.2.2: no call stack in browser

Postby seandisanti » Fri Apr 12, 2013 11:58 am

view source on the page that you're expecting to see the stack. sometimes when an error is generated, it's done so within an html tag. So the stack and error info don't actually make it to the page, they're disregarded as a bad tag
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: Xdebug 2.2.2: no call stack in browser

Postby vruiz » Mon Apr 15, 2013 7:08 am

Thanks for your support.

This is the function I use:
<?php
function recursion($x ) {
$x--;
print "$x ";
recursion($x);
}

recursion(250);
?>
This is the output I get from Apache2:
249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152

No call stack at all.
vruiz
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Apr 12, 2013 9:49 am

Re: Xdebug 2.2.2: no call stack in browser

Postby vruiz » Mon Apr 22, 2013 1:43 am

I finally got the reason for not having call stack in browser. In php.ini directive display_errors was Off.
vruiz
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Apr 12, 2013 9:49 am

Re: Xdebug 2.2.2: no call stack in browser

Postby seandisanti » Mon Apr 22, 2013 10:04 am

If it's a production server, meaning other people besides developers can interact with it, then you need to leave that setting to off, and then turn it on at the script level using error_reporting(). Just because attackers can use information from errors to target their attacks.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.