I'm trying to restart nginx from php
The problem is when I type the code from my command line everything work fine but from my php i got this as an output
* Restarting nginx nginx ...fail!
My php code is
echo shell_exec ("service nginx restart");
file permission 7777
nginx error log
2016/09/15 15:17:13 [emerg] 2872#0: open() "/run/nginx.pid" failed (13: Permission denied)
2016/09/15 15:30:30 [warn] 2997#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2016/09/15 15:30:30 [emerg] 2997#0: open() "/run/nginx.pid" failed (13: Permission denied)