繁体   English   中英

NetBeans中的CakePHP调试

[英]CakePHP debugging in NetBeans

我正在开发一个CakePHP项目,我需要使用Netbeans调试工具调试项目。 我使用这篇文章来配置调试,但它不起作用。 断点没有被击中。

php.ini中

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=8080
xdebug.remote_log="/var/log/xdebug/xdebug.log"

xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "D:/wamp/tmp"
xdebug.show_local_vars=0

项目位置

D:\wamp\www\MoDACA

PHP调试选项 (在工具>选项中)

Debugger Port: 8080
Session ID: netbeans-xdebug
Max Data Length : 2048
Stop at First Line : True

NetBeans运行配置

Project URL: http://localhost:8080/MoDACA/
Index File: index.php

高级设置

Debug URL : Ask Everytime
Debugger Proxy
Host: empty Port: 9001
Warning - Path Mapping might be needed.

该项目被设置为主项目。 我在函数editStudent中的StudentsController中设置了断点。 当我点击调试时,我将特定的URL设置为

http://localhost:8080/MoDACA/students/editStudent/1

我已经完成了上面的配置,但是当我在editStudent函数中设置断点时,它没有被命中。 有人可以帮忙吗?

确保在项目属性中选择了Web Root文件夹。

在“项目”面板中右键单击项目,然后选择“属性”,然后在左侧的“源”选项卡上单击旁边的“浏览”选择Web Root文件夹。 默认情况下,它应该是app/webroot

在项目属性中添加路径映射 - >运行配置 - >高级。 Server Path是远程服务器上的文件系统路径,而不是Web服务器路径。 因此,如果您的项目位于C:/ Projects / my_cake_php_project,而在远程服务器上,则位于/var/www/mydomain.com中,您的映射应为:

Server Path: /var/www/mydomain.com/
Project Path: C:/Projects/my_cake_php_project

至少它适用于我;-) 确保这些路径确实保存在NetBeans 8.0.1上如果您仍在编辑服务器路径/项目路径并单击“确定”路径将不会保存。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM