start server in php
#10

Quote:
Originally Posted by Cyanide
Посмотреть сообщение
You should take a look into antctrl by Westie.
This user speaks words of goodness.

First of all, you have to start the server relative to the directory. Thus, an approach similar to IronBoy is the only way:

Код:
cmd /C start /D "\server\dir\here" /B "samp-server.exe"
Also, you'll have to start the server with a COM object.

Why, you're asking me. Well, the SA-MP process doesn't daemonise - it freezes the webpage by in effect blocking the socket, so you'll have to trick it into doing so manually. I'll give you an example from my code - well, a simplified version of it:

PHP код:
$pCOM = new COM("WScript.Shell");
$pCOM->Run('cmd /C start /D "'.addslashes(COM_RELDIR).'" /B '.COM_EXEC0false); 
Pretty much the only reliable way to do things.
Reply


Messages In This Thread
start server in php - by jamesbond007 - 12.06.2011, 09:26
Re: start server in php - by Iphone1234g - 12.06.2011, 09:32
Re: start server in php - by Ironboy500[TW] - 12.06.2011, 10:14
Re: start server in php - by jamesbond007 - 12.06.2011, 10:21
Re: start server in php - by Ash. - 12.06.2011, 10:22
Re: start server in php - by jamesbond007 - 12.06.2011, 11:12
Re: start server in php - by jamesbond007 - 12.06.2011, 12:52
Re: start server in php - by Calgon - 12.06.2011, 13:07
Re: start server in php - by Cyanide - 12.06.2011, 13:11
Re: start server in php - by Westie - 12.06.2011, 21:21

Forum Jump:


Users browsing this thread: 1 Guest(s)