SA-MP Forums

Go Back   SA-MP Forums > Other > Everything and Nothing

Reply
 
Thread Tools Display Modes
Old 17/07/2011, 10:20 PM   #1
DRIFT_HUNTER
High-roller
 
DRIFT_HUNTER's Avatar
 
Join Date: Oct 2009
Posts: 1,400
Reputation: 64
Default PHP start server?

Im trying to make a server control commands so you can start/stop server from where ever you want but i cant :/

can anyone post how i can start/stop server using php?
my server path is F:\Server\samp-server.exe
DRIFT_HUNTER is offline   Reply With Quote
Old 17/07/2011, 11:23 PM   #2
Mrkrabz
High-roller
 
Join Date: Sep 2007
Location: United Kingdom
Posts: 2,084
Reputation: 258
Default Re: PHP start server?

string exec ( string $command [, array &$output [, int &$return_var ]] )

Edit: for example, exec("C:\sampsvr\samp-server.exe");
Mrkrabz is offline   Reply With Quote
Old 18/07/2011, 04:18 AM   #3
DRIFT_HUNTER
High-roller
 
DRIFT_HUNTER's Avatar
 
Join Date: Oct 2009
Posts: 1,400
Reputation: 64
Default Re: PHP start server?

Quote:
Originally Posted by Mrkrabz View Post
string exec ( string $command [, array &$output [, int &$return_var ]] )

Edit: for example, exec("C:\sampsvr\samp-server.exe");
Dont work i tried it
DRIFT_HUNTER is offline   Reply With Quote
Old 18/07/2011, 06:07 AM   #4
Mrkrabz
High-roller
 
Join Date: Sep 2007
Location: United Kingdom
Posts: 2,084
Reputation: 258
Default Re: PHP start server?

Quote:
Originally Posted by DRIFT_HUNTER View Post
Dont work i tried it
Then you are doing it wrong
Mrkrabz is offline   Reply With Quote
Old 18/07/2011, 07:52 AM   #5
Abbott
Huge Clucker
 
Join Date: Feb 2011
Posts: 214
Reputation: 67
Default Re: PHP start server?

dont use exec on windows
evr

learn SSH (linux), it's cheaper and more affective.
__________________

Abbott is offline   Reply With Quote
Old 18/07/2011, 10:53 PM   #6
DRIFT_HUNTER
High-roller
 
DRIFT_HUNTER's Avatar
 
Join Date: Oct 2009
Posts: 1,400
Reputation: 64
Default Re: PHP start server?

Quote:
Originally Posted by Abbott View Post
dont use exec on windows
evr

learn SSH (linux), it's cheaper and more affective.
The reason why i using exec is cos i using windows and windows dont have ssh or ssh2
Its a nightmare to get it working
DRIFT_HUNTER is offline   Reply With Quote
Old 19/07/2011, 07:45 AM   #7
Ironboy500[TW]
Gangsta
 
Join Date: Jul 2010
Location: Croatia
Posts: 537
Reputation: 31
Default Re: PHP start server?

Take a look at Westies Windows control panel (use search). Download it, browse PHP files a bit and find exec() command he uses to start server.
Ironboy500[TW] is offline   Reply With Quote
Old 19/07/2011, 09:44 AM   #8
Westie
Gangsta
 
Westie's Avatar
 
Join Date: Jul 2009
Posts: 877
Reputation: 58
Default Re: PHP start server?

I don't use exec() for starting anything.

Ever.

It hangs.

For Linux, I use a combination of proc_open and proc_close, and for Windows I use the WshShell COM object.
Westie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Start Server Sascha Help Archive 4 17/06/2011 02:15 PM
Server won't start TKZ227 Server Support 3 17/07/2010 08:57 PM
Server doesn't start up Andom Help Archive 4 02/09/2009 11:36 AM


All times are GMT. The time now is 03:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.