Ironboy500[MM] Posted September 7, 2010 Share Posted September 7, 2010 Hello! I am trying to start my server using ssh2 connection in PHP. PHP succefully connects but I can't start my server. I'm using this code: ssh2_exec($connection, "cd /Hosting/MTA/Server34; nohup ./mta-server34"); but it simply isn't starting my server. If I try to execute same command via putty, server starts succesfully! So any ideas why I can run it via PHP? Please Help. Thanks. Link to comment
0 dzek (varez) Posted September 7, 2010 Share Posted September 7, 2010 prepare a .sh file for starting server, and simply run it (like /home/MyUser/start-mta.sh) edit: i dont know ssh2_exec (why not just exec?) - but there should be way to get the output after execution of command - maybe you will see whats wrong Link to comment
0 Ironboy500[MM] Posted September 7, 2010 Author Share Posted September 7, 2010 I already made control panel for SAMP Servers, also using ssh2 connections and it is working normally. ssh2_exec($connection, "cd /Hosting/SAMP/Server2; nohup ./samp03svr2 &"); Any more ideas? Note: I am using Debian Lenny Link to comment
0 dzek (varez) Posted September 7, 2010 Share Posted September 7, 2010 I gave you two ideas (.sh, getting output to look for errors) and it seems like you havent used any.. Link to comment
0 MTA Team ccw Posted September 9, 2010 MTA Team Share Posted September 9, 2010 You seem to be missing the '&' at the end of the line in the MTA version. Also, to prevent excessive log size, it is advisable to use the -t option when using nohup: nohup ./mta-server -t & Link to comment
Question
Ironboy500[MM]
Hello! I am trying to start my server using ssh2 connection in PHP. PHP succefully connects but I can't start my server. I'm using this code:
but it simply isn't starting my server.
If I try to execute same command via putty, server starts succesfully!
So any ideas why I can run it via PHP? Please Help.
Thanks.
Link to comment
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now