PDA

View Full Version : Unable to get 'cpuinfo' permission denied?



chuck.bunn@zypath.com
03-06-2009, 08:27 AM
Hi,

I am running a php program to get server up time sent to me and I am having trouble getting 'cpuinfo'. The system gives me a permission denied. As a test I type the following in a terminal window:

/proc/cpuinfo

and I get the permission denied. Is there another way to get this info. In the php file I use the following line:


$procInfo = @file_get_contents('/proc/cpuinfo');
$numProcs = preg_match_all("/processor[ \t]+:[ \t]+[0-9]+/", $procInfo, $matches);


Thanks

cade
03-06-2009, 12:28 PM
You would need to type:


cat /proc/cpuinfo

at the command line, otherwise the server thinks that you are trying to execute the file which isn't possible:


-r--r--r-- 1 root root /proc/cpuinfo