Imagine I have a test.html file which contains a jQuery line which calls a test.php file like in the example below:
<html>
<head>
<title>Debug test</title>
<script src="jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready( function()
{
jQuery('#testdiv').load('test.php' );
});
</script>
</head>
<body>
<div id="testdiv">
</div>
</body>
</html>
Now imagine the php file test.php returns a result like in the example below:
<?php
test();
function test()
{
echo "Ok called me!";
}
?>
The two files of course run under a server like Apache.
What I'd like to accomplish would be something like in NetBeans Java EE debug: put a debug breakpoint in test.php fun() function and one in the jquery call inside test.html, then call localhost/test.html and see the first breakpoint inside jquery call being hit and then the second breakpoint inside test.php being hit.
How can I obtain (if possible) this using jetBrains Intellidea WebStorm and PHPStorm? Thank you
Solution :
As LazyOne suggested I should use "zero configuration" option inside PhpStorm, complete instructions at jetbrains/...
Below is a description of the steps:
Add inside /etc/php5/apache2/php.ini the lines:
[Xdebug]
zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
restart apache: "service apache2 restart"
Activate the xdebug debugger, to do this we need to set a special GET/POST or COOKIE parameter. You can do it manually, but it is much more convenient to use a special online tool bookmerklets generator
Open localhost/test.php and you will see a request to start debugging at line of test.php.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.