PHP Help


I am making a web application using PHP. I have a script which tells whether the server is up or down. It works fine when i run it. But i need to put this small script in a page and there it should display the output after every 5 minutes whether the server is up or down.

I don’t know how to do this in a web application.

Kindly help.

Thank you


If the server responsible for generating the message is down, by definition its down and wont be putting out any messages - unless you are monitoring another server.

Maybe you want Javascript on the browser to check if your server is up or not? If so try these results [google]javascript polling server[/google]


well the script is actually a ping script which tell the result. the application will be run in a dedicated server which allows php to work in shell (linux terminal)

You can setup a cron job for server status checking script to run every 5 minutes. This will get the server status every 5 minutes. Then you may have to store this data in a database and display the data in your web application from the db.

Ah, so you are testing whether Server software such as Apache is down rather than the server itself having gone off line…

You might be interested in taking up Googles Application Engine (GAE) “free if it does not consume very much” offer, and funnily enough they supply free demo app sourcecode (in Python anyway) Creating a dashboard to monitor a server each 5 minutes.