如果网站启动,如何检查php / html? [英] How to check from php/html if website is up?

查看:127
本文介绍了如果网站启动,如何检查php / html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我网站的用户检查是否有其他网站(http和/或https)。有些网站使用谷歌分析(如果我理解的话)。但我不明白他们是如何做到的。

I want the users of my website to check if any other website (http and/or https) is up. There are sites out there that use google analytics for that (if I understood it right). But I don't understand how they do it.

问题1)如何在我的网站上使用google-analytics检查是否有些其他网站上线了吗?

Question 1) How do I use google-analytics on my website to check if some other site is up?

问题2 )我如何自己做?使用PHP或JavaScript?我想知道,如果google-analytics使用多个服务器位置检查网站是否在线,而不是我将使用自己的代码的单个位置,那么它是否可能更可靠。

Question 2) How do I do it by myself? Using php or javascript? I wonder if google-analytics might be more reliable in terms if they use multiple server locations to check whether the site is online compared to a single location that I would use with my own code.

推荐答案

您可以使用服务器端Curl并监控http响应标头,网站超时。

You can use server side Curl and monitor http response header, site timeouts.

这篇关于如果网站启动,如何检查php / html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆