An article on linux.com shows a couple of examples of using PHP scripting to perform sysadmin tasks on servers.
More info can be found on the Command Line manual page on PHP.net.
More info can be found on the Command Line manual page on PHP.net.