Starting EXE file using exec()
Posted: Wed Jan 25, 2006 11:32 pm
I'm working on a game server control panel(windows based). I have everything done except one last part. I am stuck when it comes to actually starting the server. Here's what the mini control panel looks like so far:
http://24.72.116.210/servermanager/index.php?id=1
SAP: 123456
If you click "start server" thats where I'm running into the problem. It says the server is starting but it actually isn't. I checked the server processes and the process of the server isn't running. This is on a dedicated windows box.
I was advised that php isn't the best for this usage but the client I'm working with wants something to get working temporarily. This is the last strand until they can start testing the product in BETA stages. They already have a few clients willing to go onto it understanding that its just a BETA.
Here is the code:
http://24.72.116.210/servermanager/index.php?id=1
SAP: 123456
If you click "start server" thats where I'm running into the problem. It says the server is starting but it actually isn't. I checked the server processes and the process of the server isn't running. This is on a dedicated windows box.
I was advised that php isn't the best for this usage but the client I'm working with wants something to get working temporarily. This is the last strand until they can start testing the product in BETA stages. They already have a few clients willing to go onto it understanding that its just a BETA.
Here is the code:
Code: Select all
// Now start the file.
echo $exe_location;
$start_game = exec($exe_location, $error);
// Check to see if the game started okay.
if ($start_game == 0) {
echo "Your server was successfully started.";
}else{
echo "There was a problem and your server could not be started.";
}