Hello everyone! I have a quick question. I am having problems with the popen() function. I am using it to evaluate a command (obviously). Anyway, it works just fine if I run the process from command line, but when I try to use it on my webpage (which is executed by user 'apache') it does not work. The user 'apache' has all the proper permissions of executing the command I am trying to use. I have even tried the 'date' command, just to make sure. And still, nothing is being read in the stream.
Have there been any problems with apache accessing a popen stream? Or, am I just missing something?
Here is my code:
Code: Select all
$handle = popen("finger $user", "r");
$info = fread($handle, 80);
fclose($handle);
echo $info;
Again, running from command line it works. From the apache web server, nothing appears to be in the $info variable.
I would appreciate any help.
Thanks!