Netbeans xDebug only works once on a Mac

I am running Netbeans on my Mac. I installed my local server using XAMPP and installed xDebug. When I switch to a debug / breakpoint in Netbeans, I can get it to work for the first time by index. However, after the first launch, it will not attach to xDebug again unless I restart Netbeans.

How can I make sure Netbeans always attaches to xDebug? Also, how do I get Netbeans to debug something other than an index file?

+4
source share
3 answers

In php.ini add

; XDEBUG Extension zend_extension = "**ABSOLUTE_PATH_TO_XDEBUG_EXTENSION**" [xdebug] xdebug.remote_enable = off xdebug.profiler_enable = off xdebug.profiler_enable_trigger = off xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "**PATH_TO_TMP_DIRECTORY**" 

In the NetBeans IDE, select Tools> Settings> PHP> Debugging

Debug Port: 9000

Session ID: netbeans-xdebug

CHECK: Stop on the first line

Open the project. Go to Project Properties> Run Configuration . Set

Run as: local website (running on local web server)

Project URL: http: // localhost / PROJECT_PATH /

Index file: index.php

Save the project file Restart Apache Restart NetBeans, open the project, then

Debugging> Debugging Project

Should you see http: //localhost/PROJECT_PATH/index.php in the browser ? XDEBUG_SESSION_START = netbeans-xdebug in the browser, and NetBeans should stop in the first line of index.php

0
source

Try to delete all files in the tmp directory on xdebug.profiler_output_dir

I had a similar situation when xdebug worked only "once" - when loading the first page. After I emptied the tmp folder, it worked fine.

0
source

Perhaps the problem is with an incompatible version of xdebug. For example, downgrading xdebug from 2.2.4 to 2.2.3 solves the problem. http://bugs.xdebug.org/view.php?id=1038

0
source

Source: https://habr.com/ru/post/1395454/


All Articles