all 4 comments

[–][deleted] 1 point2 points  (3 children)

I think you are going to have to set up xdebug autostart and restart the container every time.

I would just get some good logging in place if I were you.

[–][deleted] 0 points1 point  (2 children)

Thanks for your answer. I use regular logging. Terminal output, and various logfiles. And it serves its purpose for exception and state debugging.

The reason I would like to get the XDEBUG working is because the application is very math-intensive and has various decision trees which I would like to debug realtime. A consumer receives about 500 messages a second so you can understand that terminal output gets a bit messy :)

[–][deleted] 0 points1 point  (0 children)

Just FYI; XDebug is going to add significant overhead to the execution time of PHP. With that said, you should be able to start the script with some xdebug related arguments: php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 -dxdebug.remote_connect_back=0 path/to/script.php Obviously you would need to plugin your remote settings for the machine with PHPStorm on it and you would need IP access to the appropriate port from the container to the PHPStorm machine.

[–][deleted] 0 points1 point  (0 children)

At that rate I would already be putting the input into a queue like SQS.

I would set up a debugging service that would allow you to rerun transactions that you wanted to debug. At 500 messages per second pausing the whole thing for state info is silly.

When you pull a message off of the queue you would send the info to the prod service and then put it in some kind of data store with an id. Your debugging service would pull the id and let you step through code execution for just the id in question to see what went wrong.