Can anyone tell me, How can i restart the apache server through php code?

if i view a specific page,my apache server should be automatically restart.
How can i perform this?

Anybody Please help me.

7 Years
Discussion Span
Last Post by Pro2000

It is not working. do i need to give some permission to system files? i m using linux.


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.

Edited by Pro2000: n/a


i just pointed apache as a example. Really i have to restart a application (it is smokeping) . evry time if i change the configuration file i have to restart manually.

so i need to have auto restart.
Is there any way to restart through php codes? i tried exec(),shell_exec(),system().
they are not working.

Any solutions plz ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.