PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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:
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.
// 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.";
}
exec($exe_location, $error, $return);
if ($return == 0) {
echo 'Server started fine';
} else {
echo 'Server not started';
}
That might get the "check if it ran" working, but it won't solve your problem of the server not running.
Has the PHP/Apache servers got access to the file? You normally find that the service providers don't like to let these things execute external programs.. it's a bit of a security nightmare at times.
exec($exe_location, $error, $return);
if ($return == 0) {
echo 'Server started fine';
} else {
echo 'Server not started';
}
That might get the "check if it ran" working, but it won't solve your problem of the server not running.
Has the PHP/Apache servers got access to the file? You normally find that the service providers don't like to let these things execute external programs.. it's a bit of a security nightmare at times.
No apache doesn't have access to the file. That might be the problem. I will check that as soon as I get access to the server.
I moved the server files(including exe file) into a folder where apache has dirrect access. It still doesn't want to start up. Now its actually saying it isn't starting though.
When I try to echo the $error variable it just returns array