How do you setup Javascript debugging when running a PHP application

OK, so I don't really understand how to setup the Javascript debugging and can't find any documentation that shows me how to configure it alongside my php as application debugger with xdebug. I have an application that I debug the PHP just fine, but how can I set a break point on a given page and when going to that page in my browser, have the break point trigger if it should. Right now I can't even put a break point on javascript. So far I have only tried inside of a phtml file that has embedded script tags. If anyone can point me in the right direction that would be great. From what I see from the configuration, it appears you need to tell the debugger a specific html file, in my case that doesn't work

I would like to have break points in my view files inside of javascript and with the php as well and I am not sure this is possible.

7 comments
Comment actions Permalink

You can use Remote JavaScript Debug configuration to debug JavaScript in running PHP app. When JavaScript debugger is started open 'Scripts' tab in 'Debug' tool window to navigate to scripts, set breakpoints in it and so on.

0
Comment actions Permalink

Wow your a genius, this worked perfectly and now has made PHPStorm the best IDE I could ever use, debuging Javascript and PHP at the same time, who would of though!!!!

0
Comment actions Permalink

Following this thread with interest, how do you start debugging? With the remote JavaScript debug configuration active, the run and debug buttons on the toolbar are not active. I also used the session variable to start debugging but I do not see a scripts tab anywhere to allow access to the JavaScript for setting breakpoints etc. What am I doing wrong (PS 2.1.3 107.515)?

0
Comment actions Permalink

Hello Navid,

Please elaborate and provide some steps to reproduce the problem.

Thank you for feedback!

0
Comment actions Permalink

Hi:

This seems to be a build specific problem. I have no problems with 2.1.2 and the current 2.1.4 builds. Talk about unlucky numbers ... :-)

0
Comment actions Permalink

I currently do all my javascript debugging using the "Firebug" plugin for firefox. Or the built in debugger in Chrome. I set all my breakpoints inside Firebug/Chrome debugger window. You can view all your variables in browser as well.

I find for my workflow this works out well for me.

O.

0

Please sign in to leave a comment.