curl and ping - how to check whether a website is either up or down?

后端 未结 7 2153
再見小時候
再見小時候 2020-11-28 12:51

I want to check whether a website is up or down at a particular instance using PHP. I came to know that curl will fetch the contents of the file but I don\'t want to read th

7条回答
  •  情歌与酒
    2020-11-28 13:07

    You can not test a webserver with ping, because its a different service. The server may running, but the webserver-daemon may be crashed anyway. So curl is your friend. Just ignore the content.

提交回复
热议问题