簡體   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