Why would you do that??
You may find a better solution to your problem if you tell us about it.
Also, if you're running your program on the internet, the server administrator must have banned changing the status of Apache.. That's, of course, because the server, mostly, has more than one website hosted on it... So restarting Apache on the server will mostly cause a problem to the other websites operating on that very server.