I have a gameserver running on Debian where players can edit an (already-running) php script via web to modify the game. However, once changes are made to the script and saved, the affects of the changes only happen once the script is killed and rebooted (I have to do this manually in terminal). Without giving shell access to users, how can the script know to reload a new version of itself once changes have been made? The script is running in a GNU Screen.
Although my overall knowledge on GNU screen, php, and linux commands are limited, I think there has to be a way for this to be done.
What would the easiest way be?
EDIT
To clarify, the script that people modify is a basic script that usually reads a server output log. So when the script sees “PLAYER_DIED” it writes to a file, which in turn is read by the server and does some stuff, like spawn a zone.
People edit this script right now with a basic web-based text editor linked to the php source code
There are numerous ways to achieve this, but it’s hard to tell which method is the best since you don’t share any of your source code.
Why not restart it within the same script that you use to let the players modify the script?
Another solution is to have a small cron-script that runs every minute to check if the file was changed. If so it will then restart the instance. In a worst case scenario, the players have to wait a minute until the changes are seen.
Also I’m wondering if you are using some kind of deamon that is running the actual script that is edited by the players or if you are running that script directly.