What I want to do with PHP on a Linux system:
This should be done by means of a graphical GUI with PHP backend.
Is there any convenient PHP-library suited for managing software on Linux, which also checks which distribution you use and adapts to the specifics of the used distribution, or do I have to use shell_exec() function in conjunction with shell commands to manage installed services?
What is the best way to achieve this with PHP?
Like you said in your question, I use shell_exec for this :
<?php
$output = shell_exec('service apache2 status');
var_dump($output);
?>
// Output : ... Active: active (running) ...