I have had a few of those. I recall we had one setup where when apache crashed, it screwed up the PID file, so when you did an apachctl call, it listed the service as already running, but it wasn't.
It'd be much easier to do with grep but it's fairly straightforward in php as well. Code: <?php //The file that you want to count downloads of $filename = 'test.gif ...