Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Somehow, one of our sites continues to be compromised. Is there a way that I can log every command that PHP runs, either via system(), exec(), etc?

share|improve this question
up vote 3 down vote accepted

You can use override-function, and rename_function rewrite the system and exec commands, do a stack trace from there and log it to a file.

share|improve this answer
Is there a way to do this across an entire site, or just for a single page? – Glen Solsberry Jun 11 '10 at 14:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.