SA-MP Server Starts Up By PHP Great!... But...
#1

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?

Код:
<?php exec('cd /***/ ; ./samp03svr &'); ?>
Info: I am running this on lighttpd /w php on Debian.
Reply
#2

I'm pretty sure you would need SSH2 not just PHP functions, correct?
Reply
#3

I have tried ssh2 but it never works... Here is my code for that...
PHP код:
$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.

Reply
#4

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');
Reply
#5

PHP код:
$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.
Reply
#6

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?
Reply
#7

That shouldn't make a difference.
Reply
#8

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.
Reply
#9

Quote:
Originally Posted by AustinJ
Посмотреть сообщение
PHP код:
$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?
Reply
#10

SSH2 is installed correctly. And the ssh user has full permissions.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)