I have xdebug configured as shown below but the error-output is totally unreadable. Do you have an idea what's wrong with the setup?
TIA & best regards
Setup: Apache/2.2.13 (Unix) PHP/5.3.0 on Snow Leopard Server
Config from php.ini:
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.remote_host=10.0.1.9
xdebug.remote_connect_back=0
xdebug.idekey="macgdbp"
xdebug.remote_port=10000
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
; profiler
xdebug.profiler_output_dir = "/tmp/xdebug/"
xdebug.profiler_enable = On
; stacktraces & var_dump() output config
xdebug.overload_var_dump=1
xdebug.show_local_vars=1
xdebug.collect_params=4
xdebug.dump.GET=*
xdebug.dump.POST=*
xdebug.dump_globals=On
xdebug.show_exception_trace=On
; codetracer
xdebug.auto_trace=On
xdebug.trace_output_dir="/Users/admin/Sites/xdebugtracer"
xdebug.collect_return=On
Output:
Notice: Undefined variable: files in /Users/admin/Sites/hanak4/scripts/jwplaylist.php on line 76 Call Stack: 0.0003 648584 1. {main}() /Users/admin/Sites/hanak4/scripts/jwplaylist.php:0 Variables in lo开发者_如何学Gocal scope (#1):
$config = class stdClass { public $showFirst = 'youtube'; public $playFirst = '01 Hanak Heumarkt.flv' } $db_host = 'localhost' $db_link = FALSE $db_name = 'db_fernan' $db_pass = 'Yes6uf5eNa' $db_prefix = 'ing_' $db_user = 'usr_fernan' $e = *uninitialized* $fh = array (0 => '{"showFirst":"youtube","playFirst":"01 Hanak Heumarkt.flv"}') $file = FALSE $files = *uninitialized* $key = *uninitialized* $parts = array (0 => 'Hanak Jeckdance 2009', 1 => 'flv') $path = '.' $pointer = resource(7) of type (Unknown) $sql = 'SELECT * FROM ing_video ORDER BY id DESC' $videos = array (0 => '01 Hanak Heumarkt.flv', 1 => 'Center TV.flv', 2 => 'Express TV.flv', 3 => 'Hanak Jeckdance 2009.flv') $xmlstr = '\n\n\t '
Warning: Invalid argument supplied for foreach() in /Users/admin/Sites/hanak4/scripts/jwplaylist.php on line 76 Call Stack: 0.0003 648584 1. {main}() /Users/admin/Sites/hanak4/scripts/jwplaylist.php:0 Variables in local scope (#1):
$config = class stdClass { public $showFirst = 'youtube'; public $playFirst = '01 Hanak Heumarkt.flv' } $db_host = 'localhost' $db_link = FALSE $db_name = 'db_fernan' $db_pass = 'Yes6uf5eNa' $db_prefix = 'ing_' $db_user = 'usr_fernan' $e = *uninitialized* $fh = array (0 => '{"showFirst":"youtube","playFirst":"01 Hanak Heumarkt.flv"}') $file = FALSE $files = *uninitialized* $key = *uninitialized* $parts = array (0 => 'Hanak Jeckdance 2009', 1 => 'flv') $path = '.' $pointer = resource(7) of type (Unknown) $sql = 'SELECT * FROM ing_video ORDER BY id DESC' $videos = array (0 => '01 Hanak Heumarkt.flv', 1 => 'Center TV.flv', 2 => 'Express TV.flv', 3 => 'Hanak Jeckdance 2009.flv') $xmlstr = '\n\n\t '
You have to set
html_errors = On
in your php.ini, this allow xdebug to output correctly.
Are you printing this between pre tags?
print '<pre>';
var_dump($my_var);
print '</pre>';
That should ensure the formatting is correct. I'm not sure why there are no colors.
It looks like your error log is not reading (or adding) a newline character between each error (or is this just how it posted to SO?)
Note: when adding code or output to a question, use the code button in the editor - it's the one that looks like 101010.
I have found the solution. I got the same "problem" since two months ago.
Try it:
Open MAMP -> go to File Menu -> Edit Template -> PHP (your-version).ini
In the end of file uncomment the Xdebug extension.
Also you can set html_errors = On
I hope help other like me.
if you are not in a position to edit php.ini and also if you miss adding pre tags , you have a another way to see the complete error , by doing a view source in any browser , I often use that to fix .
精彩评论