views:

146

answers:

2

I read call stack in Magento, but they are unreadable due to string shortage, eg:

include('/var/www/oneste...')

How can I see full string, in this case full path?

+1  A: 

Do you have xdebug installed? If yes, try these:

ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
ini_set('xdebug.collect_vars', 'on');
ini_set('xdebug.var_display_max_data', 5000);
ini_set('xdebug.var_display_max_depth',10);
ini_set('xdebug.collect_params', '4');
ini_set('xdebug.dump_globals', 'on');
ini_set('xdebug.dump.SERVER', 'REQUEST_URI');
ini_set('xdebug.show_local_vars', 'on');

/* Enable XDebug stack traces */
ini_set('xdebug.auto_trace', 1);
ini_set('xdebug.var_display_max_depth', 100);
ini_set('xdebug.var_display_max_children', 500);
wenbert
Make sure that you do not put the settings above in your production server. It will probably spit out errors or something if xdebug is not installed.
wenbert
And make sure Xdebug is not installed on your production server : it is not know for being kind with the CPU usage ^^
Pascal MARTIN
+1  A: 

By default in PHP uncaught exceptions raise fatal errors and include a limited error string, I think limited to something like 1024 characters. Exceptions include lots of trace information so this is often cut off just when it gets to the interesting bit! It's a problem that exists for any OO app in PHP, not just Magento.

To get around this you need to handle errors yourself and do something with them (i.e. log to file, email them, etc). Documentation on how to do this exists at http://uk.php.net/manual/en/function.set-exception-handler.php

A nice development technique (not to be used on a live server) is the Pretty Blue Screen by Harry Fuecks. Simply include this in the first PHP file to be accessed and it will take display lots of useful info on any uncaught exception.

http://www.sitepoint.com/blogs/2006/04/04/pretty-blue-screen/

It is also possible Magento has its own error handling, but I'm not familiar with it I'm afraid.

You may want to add the tags exception and OO to this post.

simonrjones