[英]Xdebug isn't showing php variable values or object structures in Netbeans
[英]php xdebug in netbeans - how to see values of variable?
我在php.ini
文件中啟用了xdebug
,如下所示:
[XDebug]
zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "D:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 0
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.trace_output_dir = "D:\xampp\tmp"
我的netbeans設置與他們的手冊相同。 現在,當我嘗試Ctrl + F5(在第140行設置斷點之后)時,它顯示如下:
如何在netbean的控制台下面看到$user_id
(或任何其他變量的值)的值?
或者有沒有辦法通過在CLI中設置斷點和檢查變量值來調試PHP代碼,如python import pdb;pdb.set_trace()
??? 以便代碼在特定行中斷(當采取提交形式或重新加載瀏覽器時采取行動)然后我可以在斷點之前檢查每個變量,甚至在斷點之后continue
1.查看你的php.ini配置。
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000
還要確保你的zend_extension =“D:\\ xampp \\ php \\ ext \\ php_xdebug.dll”是正確的。 在我的電腦上,我有/而不是\\,不確定是否重要...
2.重新啟動服務器(如果需要,不確定)。
3.在Tools-> options-> PHP-> Debugging中檢查您的netbeans配置
4.檢查項目屬性:“瀏覽器”和“運行配置”
如果一切正確,你可以在netbeans和laung debug中設置一個斷點:“Debug” - >“Debug project”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.