SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 21/09/2011, 03:04 AM   #1
AustinJ
Big Clucker
 
Join Date: Jul 2011
Posts: 145
Reputation: 15
Default SA-MP Server Starts Up By PHP Great!... But...

So after trying server times to get this to work correctly and configure my web server and vps it finally starts up and stays up, but the page continues to load and won't stop unless i force it to. When I force it to stop the server stay up how to I get it to stop executing the php?

Code:
<?php exec('cd /***/ ; ./samp03svr &'); ?>
Info: I am running this on lighttpd /w php on Debian.
__________________
AustinJ is offline   Reply With Quote
Old 21/09/2011, 03:19 AM   #2
Toni
High-roller
 
Toni's Avatar
 
Join Date: Aug 2009
Location: United States
Posts: 1,464
Reputation: 156
Default Re: SA-MP Server Starts Up By PHP Great!... But...

I'm pretty sure you would need SSH2 not just PHP functions, correct?
Toni is offline   Reply With Quote
Old 21/09/2011, 03:26 AM   #3
AustinJ
Big Clucker
 
Join Date: Jul 2011
Posts: 145
Reputation: 15
Default Re: SA-MP Server Starts Up By PHP Great!... But...

I have tried ssh2 but it never works... Here is my code for that...
PHP Code:
$connection ssh2_connect('***'22);

ssh2_auth_password($connection'***''***');

ssh2_exec($connection'cd /***/ ; ./samp03svr &'); 
EDIT: I have ssh2 installed. Here is a picture off my php info file.

__________________
AustinJ is offline   Reply With Quote
Old 21/09/2011, 03:32 AM   #4
Toni
High-roller
 
Toni's Avatar
 
Join Date: Aug 2009
Location: United States
Posts: 1,464
Reputation: 156
Default Re: SA-MP Server Starts Up By PHP Great!... But...

You're sure your connected right...? And it's installed correctly? Maybe also try testing it by maybe doing a simpler command like maybe just ssh2_exec($connection, 'mkdir test');
Toni is offline   Reply With Quote
Old 21/09/2011, 03:40 AM   #5
AustinJ
Big Clucker
 
Join Date: Jul 2011
Posts: 145
Reputation: 15
Default Re: SA-MP Server Starts Up By PHP Great!... But...

PHP Code:
$connection ssh2_connect('***'22);

if(
ssh2_auth_password($connection'***''***'))
{
    echo 
"Authentication Accepted.";
}
else
{
    echo 
"Authentication Denied.";
}

$stream ssh2_exec($connection'mkdir Testing'); 
I get "Authentication Accepted" when the page is executed but the directory isn't made.
__________________
AustinJ is offline   Reply With Quote
Old 21/09/2011, 03:58 AM   #6
Toni
High-roller
 
Toni's Avatar
 
Join Date: Aug 2009
Location: United States
Posts: 1,464
Reputation: 156
Default Re: SA-MP Server Starts Up By PHP Great!... But...

I have pretty much no experience but would it make a difference if say instead of single quotes you used double quotes to execute commands?
Toni is offline   Reply With Quote
Old 21/09/2011, 04:13 AM   #7
AustinJ
Big Clucker
 
Join Date: Jul 2011
Posts: 145
Reputation: 15
Default Re: SA-MP Server Starts Up By PHP Great!... But...

That shouldn't make a difference.
__________________
AustinJ is offline   Reply With Quote
Old 21/09/2011, 07:11 AM   #8
JiHost
Huge Clucker
 
Join Date: Sep 2011
Location: JiHost.co.uk
Posts: 314
Reputation: 44
Default Re: SA-MP Server Starts Up By PHP Great!... But...

exec() won't stop loading in your php script as long as server is online.
Tried using nohup instead? About ssh2, make sure you installed it correctly, maybe some modules are missing.
JiHost is offline   Reply With Quote
Old 21/09/2011, 08:23 AM   #9
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 338
Reputation: 26
Default Re: SA-MP Server Starts Up By PHP Great!... But...

Quote:
Originally Posted by AustinJ View Post
PHP Code:
$connection ssh2_connect('***'22);

if(
ssh2_auth_password($connection'***''***'))
{
    echo 
"Authentication Accepted.";
}
else
{
    echo 
"Authentication Denied.";
}

$stream ssh2_exec($connection'mkdir Testing'); 
I get "Authentication Accepted" when the page is executed but the directory isn't made.
Hmm are you sure the ssh user you login with is allowed to create new directorys in that place?
__________________
robanswe is offline   Reply With Quote
Old 21/09/2011, 10:55 PM   #10
AustinJ
Big Clucker
 
Join Date: Jul 2011
Posts: 145
Reputation: 15
Default Re: SA-MP Server Starts Up By PHP Great!... But...

SSH2 is installed correctly. And the ssh user has full permissions.
__________________
AustinJ 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
How to get script that starts EXACTLY when an NPC's path starts MisterTickle Scripting Help 11 18/09/2011 09:03 AM
Starts SP when joining a server Pwnforwildy Client Support 6 16/08/2010 12:28 PM
[HELP]Server starts then closes [NYRP]Mike. Help Archive 10 13/12/2009 01:44 PM


All times are GMT. The time now is 09:43 PM.


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