8

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

3 Answers 3

6

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

Sign up to request clarification or add additional context in comments.

Comments

3

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 )

1 Comment

Setting Maximum Data Length to a large number worked. Setting it to -1 caused an error in Xdebug.
2

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

2 Comments

Thanks alex, but I tried that. Testing with a string of about 1850 bytes - I originally had xdebug.var_display_max_data=2048 and have since bumped it up to 8192, but still can't see the variable value.
@AlienTechnology Weird, not sure if I know the answer then.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.