What permissions are required for the Apache or IIS user to restart a game server using PHP?

The Apache or IIS user would need permission to execute shell commands in order to restart a game server using PHP. This can be achieved by granting the necessary permissions to the Apache or IIS user to run the specific command needed to restart the game server.

<?php
// Execute shell command to restart game server
$output = shell_exec('sudo systemctl restart game_server.service');
echo $output;
?>