Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Current Activity of Running PHP Process

Tags:

php

debugging

I have a PHP script running that's taking hours, it usually takes a long time, but I'm unsure as to what it's doing or how long it's going to be.

I know I can see how long it's been running and memory using through "top", but is there any way I can actually see which lines are being processing right now in a running PHP process?

like image 663
Alasdair Avatar asked Feb 16 '26 23:02

Alasdair


1 Answers

options are:

  • log everything to some log file (before and after every line of code)
  • use strace to check which system calls your process is doing right now
  • enable xdebug in php and remotely connect to your script from some IDE which supports it.
like image 76
Vitaly Dyatlov Avatar answered Feb 18 '26 13:02

Vitaly Dyatlov