0

I'm a coder of a server, and when I crash the server I have no way to start it back up unless the host is here. I've been trying to execute the file via PHP, and so far so good. However, with this method, the server is spammed with "Usage: /say " (consolelikechat plugin). From what it seems, when I use the following:

chdir('C:/SERVERS/BUKKIT/');
system('"C:\\Program Files\\Java\\jre7\\bin\\java.exe" -server -Xincgc -Xmx8192M -jar     craftbukkit.jar'); ?>

the input of '' is being sent to the server at a very high speed. I have tried using popen and shell_exec, however these do not even start the server. Running it from the .bat file just returns the command. Sorry if this is not clear enough, it is the best I can do to explain the problem.

Drew Lemmy
  • 447
  • 1
  • 4
  • 13

1 Answers1

0

Try escaping your slashes maybe?

system('"C:\\Program Files\\Java\\jre7\\bin\\java.exe" -server -Xincgc -Xmx8192M -jar craftbukkit.jar 2>&1');

Sanchit
  • 2,240
  • 4
  • 23
  • 34
  • The slashes worked non-escaped somehow, I believe it was being inside a triple quote. I escaped them anyway, and same results. – Drew Lemmy Jan 11 '14 at 15:52
  • ok try adding `' 2>&1'` to the end of the command. System apparently escapes stuff for you if safe_mode is enabled. – Sanchit Jan 11 '14 at 15:55
  • If this was what you meant: `system('"C:\\Program Files\\Java\\jre7\\bin\\java.exe" -server -Xincgc -Xmx8192M -jar craftbukkit.jar 2>&1');` it didn't work :/ – Drew Lemmy Jan 11 '14 at 15:57
  • I'm just suggesting you answers from `http://us3.php.net/system` look into the comments section apparently lots of people having WINDOWS specific advice. – Sanchit Jan 11 '14 at 15:57
  • I couldn't find a solution on there – Drew Lemmy Jan 11 '14 at 16:16