how to debug javascript in php file?

If I create a file with .html extension the debugger works fine with lines that are written with javascript. But this time if there is some PHP code around,  than PHP debugging is off.  On the other hand , If I create a file with .php extension and I use javascript in this file ; it is impossible to debug javascript lines.

Can somebody give me an advice ??

3 comments
Comment actions Permalink

I'm using the very latest version of phpStorm (10.0.03) on Windows 7 Pro.

The instructions linked to above suggest that you need to first install Zend or Xdebug.

But the instructions for installing those make it sound like they are only needed for a non-phpStorm server.

Also, Xdebug seems to be for Mac and the Zend says you should use Xdebug.

If I am able to set Breakpoints for js lines in a .js file, just not in a .php file, then do I still need to install one of the above (Zend or Xdebug)?

 

(Zend and Xdebug just seem like I'm about to go down a long rabbit hole)

0
Comment actions Permalink

If all you want is debugging javascript, you don't need XDebug, you just need using JavaScript Debug run configuration; but note that it's not currently possible to set JavaScript breakpoints in javascript code embedded in PHP (via <script> tags) - see https://youtrack.jetbrains.com/issue/WEB-2099. You have to move all your javascript code to a separate .js file(s) and link them to tour .php page via <script src="path/to/js">

0

Please sign in to leave a comment.