As a relative newbie in the world of Linux debugging via gdb, etc. I'm looking for help with an issue we're seeing.
On a hosted/managed "VPS" (virtual private server - we're mostly, but not entirely, in control of the configuration) we observe that occasional PHP processes stick around "forever". Most web hits come and go normally, but these ones will last for tens of minutes if we don't identify and kill them ourselves.
I'd like to gdb attach to the processes and get a stack trace, but I'm not sure how. I'm also not sure if we need to be running PHP with debugging enabled.
Is there an easier way (maybe in the PHP code itself) to identify long-running PHP processes? Might help us if it's something simple like getting stuck in an infinite polling loop.