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.

storm.gif

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

  • 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

storm.gif

  • 0
Posted

I gave you two ideas (.sh, getting output to look for errors) and it seems like you havent used any..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

  • 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...