sle09 Posted August 1, 2008 Share Posted August 1, 2008 ok this is a complex question over all im trying to execute this command through a php file when i type "cd /server && ./samp" on the command line i get "Started Server on port: 8082, with maxplayers: 32 lanmode is OFF." which is perfect, i test and yup the game server is running now i made a file called start.php and it contains: <?php $cmd = 'cd /server && ./samp &'; echo "<pre>".shell_exec($cmd)."</pre>"; ?> when i go to start.php in browser is says "Started Server on port: 8082, with maxplayers: 32 lanmode is OFF." same thing as when i run in it the command line, but when i check to see if its really running, its not. ive also tried: <?php echo exec('cd /server && ./samp &'); ?> with the same failure please help Link to comment https://forums.phpfreaks.com/topic/117678-php-execute/ Share on other sites More sharing options...
bretticus Posted August 1, 2008 Share Posted August 1, 2008 What happens if, from the command line, after typing "cd /server && ./samp", you type control-d? Does that kill the process? I assume that shell_exec and exec both send an eof (control-d) after the command? Now it appears you already noted this because I see you have a background operator at the end of your php commands. So a better question might be, what happens when you type "cd /server && ./samp &" from the command line? Does the process continue to run in the background? Also, have you tried: echo exec('/server/samp &'); Link to comment https://forums.phpfreaks.com/topic/117678-php-execute/#findComment-605325 Share on other sites More sharing options...
sle09 Posted August 1, 2008 Author Share Posted August 1, 2008 how would i either make shell_exec not send the control-d after or make my process run after that? Link to comment https://forums.phpfreaks.com/topic/117678-php-execute/#findComment-605514 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.