Xdebug Giving "undefined function" errors.

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Xdebug Giving "undefined function" errors.

Post by Chris Corbyn »

I've compiled Xdebug and linked it with php. I can run the script:

Code: Select all

<?php

error_reporting(E_ALL);
ini_set('display_errors', 'On');

xdebug_start_code_coverage();

function a($a) {
	$f = $a * 2.5;
}

function b($count) {
	for ($i = 0; $i < $count; $i++) {
		a($i + 0.17);
	}
}

b(6);
b(10);

//echo xdebug_peak_memory_usage().'<br />';

var_dump(xdebug_get_code_coverage());

?>
But when I make calls to certain functions (get_memory_usage() being one) I get an undefined functin error.

I expected this to be because, as it says in the Xdebug documentation you need PHP compiled with --enable-memory-limit for those functions to work.

I have that though :(

From phpinfo()
Configure Command './configure' '--prefix=/usr/local/php5' '--with-apxs2=/usr/sbin/apxs' '--enable-memory-limit' '--with-mysql' '--with-openssh'
Here's what it says for Xdebug in phpinfo()

Code: Select all

xdebug
xdebug support	enabled
Version 	2.0.0beta5

XDEBUG NOT LOADED AS ZEND EXTENSION

Supported protocols	Revision
DBGp - Common DeBuGger Protocol 	$Revision: 1.74 $
GDB - GNU Debugger protocol 	$Revision: 1.77 $
PHP3 - PHP 3 Debugger protocol 	$Revision: 1.19 $

Directive	Local Value	Master Value
xdebug.allowed_clients	no value	no value
xdebug.auto_trace	Off	Off
xdebug.collect_includes	On	On
xdebug.collect_params	Off	Off
xdebug.collect_return	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.idekey	d11wtq	no value
xdebug.manual_url	http://www.php.net	http://www.php.net
xdebug.max_nesting_level	100	100
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	crc32	crc32
xdebug.remote_autostart	Off	Off
xdebug.remote_enable	Off	Off
xdebug.remote_handler	dbgp	dbgp
xdebug.remote_host	localhost	localhost
xdebug.remote_mode	req	req
xdebug.remote_port	9000	9000
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	crc32	crc32
Where it says "Not loaded as Zend extension" I don't get it... is that normal? Xdebug is working, just some functions aren't :(
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I was talking to someone at work about this and he's had the same issues and never solved them. Seems it works with PHP4 but there's no getting it to work in PHP5 properly :( I'll have to do my benchmarking in PHP4 (meh... PHP4 uses less memory anyways :P)
Post Reply