PDA

View Full Version : phpQStat / Linux and PHP Help!!!


sexydawg
03-23-2001, 02:51 AM
I am trying to run a small linux program called "QStat" through a PHP Script. This program sends a request for basic info from a multiplayer game server (Half-Life). The programs receives the information (Player names, points, etc) from the server, and outputs it.

I am using the exec() function in PHP to run this program and draw the output into an array called $result. However, when I run the PHP script, the array remains empty. I have been told this code works fine on other sites. Below is a simple version of the code I was using just to run the program and check for any output whatsoever:

<?php
$param = "qstat -R -P -".$game." ".$host." -raw ,";
exec($param, $result);
echo($result[1]);
?>

I know the command line is right, because I can telnet in and run it with that command line, and everything works fine. If I telnet and run it, it outputs the data I want to the screen. However, it just doesn't seem to output anything to the PHP script.

Maybe this is a problem with file permissions? I've tried pretty much every permission setup I could think of. Both files are in the public_html directory.

On a side note, I tried adding the optional return code variable into the statement, and the return code was "127". Does anybody know what that means on Linux?

Thanks in advance...

- Brandon

sexydawg
03-27-2001, 12:51 AM
Anybody??? ... :(