![]() In this regard it is much easier just remove xdebug cookie with browser extension or bookrmarklet than edit php.ini, restart webserver all the time when you need to switch between debug/normal run.With the debugging engine installed, you can start debugging by following the zero-configuration debugging approach:Ĭhoose and install the browser extension suitable for your browser. Because of that, the website may look a bit slow, especially if you have few ajax requets etc. It can wait up to whole second or so (based on my observations) before proceeding with normal page execution. One small thing to add about remote_autostart - xdebug tries to connect to client on every request, even if there is no client listening. But even if I would have the similar circumstances, this time I can create another site just for debugging that code (even if it will take some time) as I have full control over the server (last time it was completely different). I do not have such circumstances any more and have not tested that option since then (everything works just fine without it). That's why I wrote " it really depends on your setup and workflow". With that xdebug option, I was often interrupted with requests for other pages which I did not do. If you do not need to debug that file, then for me PhpStorm just offers to debug postback.php straight awayĭon't think anything can be done here - it was long time ago (over a year, if I recall correctly) and it was my specific circumstances: while I was debugging some code, the site was used by other people as well (checking pages, adding products etc) - all on the same dev site as latest code was a requirement ("I want to see progress/changes immediately, very very important" - this kind if thing). For me PhpStorm opens another session just for that included file (postback.php)ī) If it does not ask to debug the test_postback.php (but you need to debug it) - then you may need to use bookmarklet or some browser extension etc to set that debug cookie/parameter. and debug halts on that line, just disconnect ("Stop" button) debugger session. Open that page (test_postback.php) in browser (you can use Run button instead of Debug for the same configuration)Ī) PhpStorm may ask you to debug your test_postback.php file. ![]() Turn on "Run | Start Listen PHP Debug Connections"Ĥ. Make sure you have "Break at first line (for external connections)" selected in Settings | PHP | Debug (although this is optional if you are using breakpoints - it's just a bit more safer)ģ. $dbg ='&XDEBUG_SESSION_START=PHPSTORM' // or whatever other IDE Key and then it just stops (no more debugging available) when calling that second page - don't know what I have done wrong, but that is what I've had.Īnother possible approach (worked better for me): $url = " Use it with PHP Web Application configuration type (using Debug button). Therefore I suggest: $dbg = isset($_GET) ? '&XDEBUG_SESSION_START='. when debugging, the xdebug cookie (or parameter) needs to be passed as well (I'm assuming you are using xdebug here). ![]() Q: why not debug postback.php directly? - will be much easier. Is there some way that I can get PHPStorm to go into debug mode for this situation? "postback.php" is quite complex and relies on a number of other scripts, so it took me a while to track down the error. I more or less understand why - "test_postback.php" is called from the browser, but "postback.php" itself is called from PHP. I tried setting breakpoints, and although it broke in "test_postback.php" it didn't break in "postback.php". E.g.Įcho when I ran it I was getting an error back. This script simply provides a form where I can fill in parameters, and then when posted it build the url and gets a response using the file() function. In the live environment, another server is calling " ".įor testing I set up a simple script, called "test_postback.php". Part of a project I am working on includes a postback URL, let's call it "postback.php".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |