Hi Posde & Phenigma
Thanks for the replies.
The problem wasn't the PHP script, you had to allow access in the visudo ( Posde thanks for pointing me in right the direction ), according to a topic on the the internet the permission is
# Cmnd alias specification
Cmnd_Alias DANSGUARDIAN = /etc/init.d/dansguardian, /usr/sbin/dansguardian
# User privilege specification
root ALL=(ALL) ALL
www-data ALL=NOPASSWD: DANSGUARDIAN
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
%www-data ALL=NOPASSWD: DANSGUARDIAN
This allowed PHP to executed the command to restart DansGuardian.
You can see it working in this quick video, to get around the error of no response received from the server after submitting the command, I put in a 10 second delay, and then a finish button to bring you back home.https://www.dropbox.com/s/mv2m300lhf0rjf8/videoclip2%20DansGuardian%20restart.mp4?dl=0
In order for the PHP scripts to work, visudo has to be edited with the above code, writes access given to the dansguardian LISTS
I have written a PHP script to check if the database exists, if not, create the database and import the tables.
Here's a short video of it creating the database and then importing the sql file https://www.dropbox.com/s/vh83kyopg86sxkl/databaseimportandcreate.mp4?dl=0
I am working on this as a plugin, it has its own folder inside the /var/www/lmce-admin, this allows me to move it to any version of LMCE, the only cache is, DansGuardian and squid3 have to be installed first and some editing done to the IP-tables.
On that note, thanks for the replies I will keep you posted!