random1 Posted July 2, 2008 Share Posted July 2, 2008 I have the following function: public function serverUptime() { $uptime = shell_exec("cut -d. -f1 /proc/uptime"); $days = floor($uptime/60/60/24); $hours = $uptime/60/60%24; $mins = $uptime/60%60; $secs = $uptime%60; return "This server is up $days days $hours hours $mins minutes and $secs seconds"; } This is not working on my Windows machine. I think the above is for unix based servers. What's the Windows equivilent of 'cut'? P.S I get: 'cut' is not recognized as an internal or external command, operable program or batch file. in the Apache error log. Link to comment https://forums.phpfreaks.com/topic/112904-determine-server-uptime/ Share on other sites More sharing options...
rhodesa Posted July 2, 2008 Share Posted July 2, 2008 windows doesn't have a cut or uptime command. here is something i found though that tells you how to get it for windows: http://www.xenocafe.com/tutorials/php/realtime_server_uptime_in_windows/index.php Link to comment https://forums.phpfreaks.com/topic/112904-determine-server-uptime/#findComment-579967 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.