PHP and SSH
#1

Ok i have been banging my head for like half an hour just why my command is not working from PHP but it does from terminal.

Then i decided to switch from ' to " and it works! Now the question is why the fuck its working like these?
pawn Код:
//Does not work (No error, no return string, and it does not return false, and it does not start server)
$stream = ssh2_exec($connection, 'screen -dmS ', $username ,' ./samp03svr');

//Works (Returns empty result as it should)
$stream = ssh2_exec($connection, 'screen -dmS sampsrvuser ./samp03svr');

//Works in a strange way, it drops empty return and empty error, but it works (maybe something with how screen works)???
$stream = ssh2_exec($connection, "screen -dmS ". $username ." ./samp03svr");
Could anyone explain me why it doesn't work if i use single quotes and variable in a string but does with double quotes or if i dont use variable to format string?
Also $username is defined as: $username = 'sampsrvuser'; so i dont see any problem there...
Reply


Messages In This Thread
PHP and SSH - by DRIFT_HUNTER - 06.09.2015, 10:27
Re: PHP and SSH - by Potassium - 06.09.2015, 11:37
Re: PHP and SSH - by DRIFT_HUNTER - 06.09.2015, 15:11
Re: PHP and SSH - by Potassium - 06.09.2015, 21:24

Forum Jump:


Users browsing this thread: 1 Guest(s)