how can i restart apache2 service using php script?

Viewed 1680

i am not able to restart server by using exec("sudo service apache2 restart"); in php script. i have given 777 permission to /etc/init.d/apache2. also added www-data ALL=NOPASSWD: ALL to visudo.

still can't able to restart using php script.

1 Answers

before exec("sudo service apache2 restart"); this.

you need to set server configurations.

Related