如何使用 NetBeans 和 x-debug 查看长字符串的值?
x-debug 或 NetBeans 是否有设置来扩展其显示的最大字符串大小?
使用 NetBeans 在 Windows 中调试 PHP 应用程序,我可以添加监视或将鼠标悬停在任何变量上以查看其值。但对于长字符串,我得到的只是(字符串),没有任何值。
环境: Windows 7、NetBeans 7.0.1、x-debug 2.0.3-5.1.7、Apache 2.0.63、PHP 5.1.6
php.ini 包含:
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将 xdebug.var_display_max_data 设置为 -1 似乎已经解决了问题。希望这对其他人有帮助。
Setting xdebug.var_display_max_data to -1 seems to have fixed the problem. Hope this helps someone else.
即使您的字符串限制在 xdebug 中没有问题,但在 netbeans 中仍然可能会出现问题。
为此,请转到
Options -> PHP-> netbeans 中的“调试”选项卡并将“最大数据长度”设置为一个较大的数字,例如 100000(我认为 -1 也应该在这里工作)。
(提示来自 https://netbeans.org/bugzilla/show_bug.cgi?id= 215728#c6)
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 setMaximum 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 )
修改
xdebug.var_display_max_data
。默认值为512
,因此请将其增加到您想要的长度。Modify
xdebug.var_display_max_data
. The default value is512
, so bump that up to your desired length.