To execute a script as root, you should probably set the setuid bit:
However, setting the setuid bit for a script, which is activated by your webserver, is a security risk.
The alternative is to set a 'flag' somewhere (e.g. by creating a dummy file) and have a root cron script check if that file exists. If exists, restart apache and remove the flag file. Of course there are other mechanisms possible. You could have the crontab scan/run every minute. That way it will only take a minute before action is taken.