[PHP] starting the server with php -
StrickenKid - 05.09.2009
Ok, im having no luck with this and its making me frustrated, im trying to make a php panel to start stop and restart the server and when it starts, it says i haven't changed the pass and i have....
This is the code im using:
Код:
$Command = "j:\\SAMPSERVER\\samp-server.exe";
$Shell = new COM("WScript.Shell");
$output = $Shell->Exec($Command)->StdOut->ReadAll;
echo '<textarea name="" cols="70" rows="15">'.$output.'</textarea>';
and this is the output:
Код:
----------
Loaded log file: "server_log.txt".
----------
SA:MP Dedicated Server
----------------------
v0.2X, ©2005-2008 SA:MP Team
Unable to exec file 'server.cfg'.
Error: Your password must be changed from the default password, please change it.
Anyone know why this is happening and how to stop it?
Thanks.
Re: [PHP] starting the server with php -
CJ101 - 05.09.2009
is your password is server.cfg "changeme"? you need to change it.
Re: [PHP] starting the server with php -
StrickenKid - 05.09.2009
read.
Quote:
it says i haven't changed the pass and i have....
|
Edit: also i know it works because if i manually click on the server exe, it starts fine...
Re: [PHP] starting the server with php -
Mrkrabz - 06.09.2009
Its because its not reading from the CFG, from what i remember, but i cant exactly remember how i fixed it.
But you got to link it somehow xD
Re: [PHP] starting the server with php -
Norn - 06.09.2009
Quote:
Originally Posted by Mrkrabz
Its because its not reading from the CFG, from what i remember, but i cant exactly remember how i fixed it.
But you got to link it somehow xD
|
How can you link it, SA-MP server loads it. It can't be loaded externally..
Re: [PHP] starting the server with php -
Mrkrabz - 06.09.2009
Quote:
Originally Posted by Norn
Quote:
Originally Posted by Mrkrabz
Its because its not reading from the CFG, from what i remember, but i cant exactly remember how i fixed it.
But you got to link it somehow xD
|
How can you link it, SA-MP server loads it. It can't be loaded externally..
|
That's what i don't understand, i cant remember what i did :<
Re: [PHP] starting the server with php -
DeathOnaStick - 12.04.2011
I just got (almost) the same problem. I'm able to execute the executable file, but it gives me the lines, that had been mentioned above, as an output. Any suggestions?
For those that care, it's java code, here the (relavant) lines:
pawn Код:
Process proc=null;
Runtime rt=Runtime.GetRuntime();
proc=rt.getRuntime().exec("C:\\Samp\\sampserver.exe");
The code works so far, but I get the output that has been mentioned above.
Thanks in advance.
Re: [PHP] starting the server with php -
saiberfun - 12.04.2011
had this problem too
would be nice to see how it's to be fixed
Re: [PHP] starting the server with php -
Mauzen - 12.04.2011
I had the same problem on linux, but i think it both is caused by the same thing.
When you start the server like this, the current working directory will be the php root dir, and not the server dir. So the server tries to find the server.cfg in the php root, but doesnt find one, this is why it gives the error.
You will have to use "cd /server_dir" first or override the working directory in another way.
Re: [PHP] starting the server with php -
DeathOnaStick - 12.04.2011
Quote:
Originally Posted by Mauzen
I had the same problem on linux, but i think it both is caused by the same thing.
When you start the server like this, the current working directory will be the php root dir, and not the server dir. So the server tries to find the server.cfg in the php root, but doesnt find one, this is why it gives the error.
You will have to use "cd /server_dir" first or override the working directory in another way.
|
Well, I changed the working directory if I did not make any mistakes, but the problem still exists.
Again, for those who care, here the (relevant) code:
pawn Код:
directory=input;
System.setProperty("user.dir", directory);