Jump to content
  • 0

PHP Starting Server


Ironboy500[MM]

Question

Posted

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.

4 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted

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

  • 0
  • MTA Team
Posted

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 & 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...