Posts

Showing posts with the label php cpu load

How to check server processor load in percentage with php script code !!

Run this code <?php     header("Content-Type: text/plain");     function _getServerLoadLinuxData()     {         if (is_readable("/proc/stat"))         {             $stats = @file_get_contents("/proc/stat");             if ($stats !== false)             {                 // Remove double spaces to make it easier to extract values with explode()                 $stats = preg_replace("/[[:blank:]]+/", " ", $stats);                 // Separate lines                 $stats = str_replace(array("\r\n", "\n\r", "\r"), "\n", $stats);                 $stats = explode("\n", $stats);     ...