I have a Windows Server with XAMPP (Apache 2.4 and PHP 7 running) and i want to build a PHP script that can start and stop a few game servers on the same machine.
I am struggling with the Minecraft Server right now, so let's take this as an example:
I have a folder called C:\_tekkitlite
where the minecraft server is in. In these folder are these files (and a few others which are unimportant):
launch.bat
minecraft_server.jar
TekkitLite.jar
The C:\_tekkitlite\launch.bat
has the following code in it:
java -Xmx3G -Xms2G -jar TekkitLite.jar nogui
pause
My current C:\_xampp\htdocs\startserver.php
looks like this:
system('C:\_tekkitlite\launch.bat');
When I execute the line above, I get the following message
C:\_xampp\htdocs>java -Xmx3G -Xms2G -jar TekkitLite.jar nogui C:\_xampp\htdocs>pause Dr�cken Sie eine beliebige Taste . . .
The problem is that there is no java process running on the machine and consequently the minecraft server is offline.
When I change the C:\_xampp\htdocs\startserver.php
to the following:
system('java -Xmx3G -Xms2G -jar C:\_tekkitlite\TekkitLite.jar nogui');
i get no message from php (i think because there is no pause
at the end of this code) BUT i get a java process and a server running.
The problem is that you cannot join this server because it seems that the server doesnt do anything. Normally a minecraft server creates a bunch of files after starting, mine doesn't when I start it with the script above.
From now on, I dont know what to do. Did I make a mistake somewhere?
I think the permissions are not a problem because when I create a batch on C:
with
echo "TestTestTestTest"
pause
php outputs this TestTestTestTest just fine.