06.09.2015, 10:27
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?
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...
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");
Also $username is defined as: $username = 'sampsrvuser'; so i dont see any problem there...