Debugging connection from browserless app

Hello !

I have developped a symfony2.8 website using phpstorm which I have debugged succesfully using a browser and xdebug within phpstorm.

Now I have added the possibility for a standalone application, written in Qt/C++ to connect to the webserver to upload data. I use the integrated server (app/console server:run) and I can connect from the C++ app, but I would like to be able to debug the connection, examine POST variables and so on ...

All I have read involves the use of a browser - How to do in this specific case ??

Thanks in advance for any help available !


Comment actions Permalink

Just to make it more clear : I would like to execute the controller code step by step after it has received the request from the C++ app. Thanks

Comment actions Permalink

OK !

I have found the answer to my own question. I post it here in case somebody else is interested, and I'll close the case.

The answer is very simple : the C++ app just need to post an aditionnal parameter to start the debugging session :

XDEBUG_SESSION_START=name, where name is any name (a character string). The phpstorm will stop on breakpoints and show all data and variables.

Comment actions Permalink


A) configure your xdebug to debug every incoming request (which should not be a problem in dev environment) -- "xdebug.remote_autostart = 1"

B) or just place "xdebug_break();" in your PHP code (programmatic breakpoint; also initiates debug session)

Both of the above requires no configuration/changes (e.g. recompilation) from C++ app (which could be needed with extra query parameter)

Comment actions Permalink

HI Andriy !

Thanks for the detailed and very helpful answer ! I'll try these right away.


Please sign in to leave a comment.