title: Restart Nginx through a PHP Script
body: <p>I'm currently working to make a WordPress plugin of mine compatible with nginx. This plugin requires access to a <code>.conf</code> file in the <code>wp-content/uploads</code> directory, so that it can add in the required rules. Currently, it updates an <code>.htaccess</code> file in the same directory, and the changes take effect immediately without intervention. Because nginx requires <code>service nginx reload</code> to allow configuration changes to take effect, I am looking for a way to do that in my script. I'm not sure that even <code>exec()</code> would work for this, as <code>service nginx reload</code> is required to be run as root or using sudo. I've searched far and wide on StackExchange, Google, and everywhere else that I know of, and I can't even find a starting place.</p>