I have done a couple hours of research and have found a solution, however I would prefer a solution without using the exec command.
Currently I have this code:
exec ("cat /proc/cpuinfo", $details);
$string= $details[4];
I basically would like it to pull the first processor's type, like that code does, but without using the system or exec command.
I would prefer to read directly from /proc/cpuinfo.
All you're doing is getting information from a file. This can be done with native PHP functions. The simplest way of doing this (and the most similar to your current solution) is with file
:
$file = file('/proc/cpuinfo');
$proc_details = $file[4];
Just put the code below:
<pre>
<strong>Uptime:</strong>
<?php system("uptime"); ?>
<br />
<strong>System Information:</strong>
<?php system("uname -a"); ?>
<br />
<strong>Memory Usage (MB):</strong>
<?php system("free -m"); ?>
<br />
<strong>Disk Usage:</strong>
<?php system("df -h"); ?>
<br />
<strong>CPU Information:</strong>
<?php system("cat /proc/cpuinfo | grep \"model name\\|processor\""); ?>
</pre>
And you will get something like :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With