问题
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
回答1:
Setting xdebug.var_display_max_data to -1 seems to have fixed the problem. Hope this helps someone else.
回答2:
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 )
回答3:
Modify xdebug.var_display_max_data. The default value is 512
, so bump that up to your desired length.
来源:https://stackoverflow.com/questions/8639530/how-to-view-value-of-long-strings-using-netbeans-and-x-debug