To debug JavaScript in Chrome, you must use the official extension https://netbeans.org/kb/docs/webclient/html5-js-support.html
After creating a new project, you should "Confirm that Chrome using the NetBeans Connector is selected in the drop-down list on the toolbar":

(it looks like this in my NetBeans:
)
Place some breakpoints before some lines:

and click "Run." After clicking the Run button, you will see a yellow warning panel that looks something like this: "NetBeans Connector" debugs this tab:

DO NOT open the Chrome Built-in Web Inspector toolbar (or you will receive a warning that this disrupts the regular debugging process in NetBeans).
Now you can debug JavaScript code in NetBeans, the code will run in Chrome. You should open Window -> Debugging -> Variable Panel to check the variables.
Or hover over some items:

Regarding debugging PHP code, here are some relevant official articles:
source share