简体   繁体   中英

CakePHP debugging in NetBeans

I'm developing a CakePHP project and i need to debug the project with Netbeans debug tools. I have used this post to configure debugging but it does not work. Break points are not hit.

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

Project Location

D:\wamp\www\MoDACA

PHP Debugging Options (in Tools > Options )

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

NetBeans Run Configuration

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

Advanced Settings

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

The project is set as the Main Project. I set the break point in the StudentsController in function editStudent . When i clicki debug i set the specific URL as

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

I have done the above configuration but when i set the break point in side the editStudent function it is not hit. Can someone please help?

Make sure you have selected Web Root folder in the project properties.

In the Projects panel right click your project, then select Properties, then on the Sources tab on the left select your Web Root folder by clicking "Browse" beside it. By default it should be app/webroot

Add Path Mapping in Project properties -> Run Configuration -> Advanced. Server Path is file system path on remote server, not web server path. So, if your project is in C:/Projects/my_cake_php_project and on remote server it's in /var/www/mydomain.com your mappings should be:

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

At least it works for me ;-) Make sure that those paths are really saved On NetBeans 8.0.1 if you're still editing Server Path/Project Path and click 'OK' paths won't be saved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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