Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view value of long strings using NetBeans and x-debug?

Is there a setting for x-debug or NetBeans to extend the maximum string size it will display?

Using NetBeans to debug PHP application in Windows, I can add a watch or hover over any variable to see its value. But for long strings, all I get is (string), no value.

Environment: Windows 7, NetBeans 7.0.1, x-debug 2.0.3-5.1.7, Apache 2.0.63, PHP 5.1.6

php.ini contains:

zend_extension_ts = c:\wamp\bin\php\php5.1.6\ext\php_xdebug-2.0.3-5.1.7.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.var_display_max_data=2048
like image 505
Alien Technology Avatar asked Dec 26 '11 22:12

Alien Technology


3 Answers

Setting xdebug.var_display_max_data to -1 seems to have fixed the problem. Hope this helps someone else.

like image 103
Alien Technology Avatar answered Sep 28 '22 04:09

Alien Technology


Even if your string limits are OK in xdebug, you can still have problems in netbeans.

For this goto to Options -> PHP -> Debugging tab in netbeans and set Maximum Data Length to a large number like 100000 (I think -1 should also work here).

(Tip from https://netbeans.org/bugzilla/show_bug.cgi?id=215728#c6 )

like image 45
Sid Kshatriya Avatar answered Sep 28 '22 05:09

Sid Kshatriya


Modify xdebug.var_display_max_data. The default value is 512, so bump that up to your desired length.

like image 24
alex Avatar answered Sep 28 '22 04:09

alex