How to debug JavaScript and PHP together in one NetBeans project (7.3)?

In my first steps, I use this non-rational way, as described below:

  • Create an HTML5 project to debug JavaScript code.
  • Create the final PHP project with already tested JS code, where I am debugging the server side.

So I'm wondering if there is a smarter way to do this?
For example: create a unique project and switch between NetBeans native JavaScript debugger and (PHP) XDebug .

+6
source share
1 answer

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":

Confirm that Chrome with NetBeans Connector is selected in the dropdown list in the toolbar

(it looks like this in my NetBeans:
NetBeans Connector )

Place some breakpoints before some lines:

Js code breakpoints

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:

"NetBeans Connector" is debugging 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:

NetBeans JS code debugging; variable


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

+5
source

All Articles