PHP uptime scripts for Windows and Linux

I found this on the web and it’s pretty clever – since, unlike Unix, Windows doesn’t have a standard “uptime” function to display the time a server’s been running. There are a couple of issues, though. The original code was missing a line (line #15) which threw a non-fatal error. In other words – following a tip from another web page – I added the line

And here’s something very odd: when placed in a web page – apart from WordPress – this thing works perfectly. If used as an include, or, in conjunction with a PHP code plugin in WordPress it adds 5 hours to the total uptime. Of course, I have no idea why this is the case……

For Linux

MS Servers

Leave a Reply

Your email address will not be published. Required fields are marked *

Anti-Spam Quiz: