如何找到在不同域名上运行的 php 版本?
如何找到在具有不同域名的不同服务器上运行的 php 版本? (如 www.abc.com)这不是我的服务器,没有 ftp 访问权限来使用以下代码创建 php 文件:
<?php
echo PHP_VERSION;
?>
How can I find the version of php that is running on a distinct server with distinct domain name? (like www.abc.com) It is not my server, no ftp access for making a php file with this code:
<?php
echo PHP_VERSION;
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
这对我有用:
显示这样的结果或类似的结果,包括 PHP 版本:
请注意,如果您收到此消息:
您可能需要卷曲网站的 www 版本,即:
This works for me:
Which shows results like this or similar including the PHP version:
Note that if you receive this message:
You may need to curl the www version of the website instead i.e.:
我使用 redbot,这是一个很棒的工具,可以查看 PHP 版本,还可以查看许多其他有用的信息,例如标头、编码、keepalive 等等。
上尝试一下,
在http://redbot.org
我喜欢它!
我也赞成尼尔的回答:
curl -I http://websitename.com
I use redbot, a great tool to see the PHP version, but also many other useful infos like headers, encoding, keepalive and many more.
Try it on
http://redbot.org
I love it!
I also up vote Neil's answer:
curl -I http://websitename.com
有时,PHP 会发出一个
X-Powered-By:
响应标头,您可以使用 Firebug 等查看该标头。如果此设置(由 ini 设置
expose_php
控制) ) 被关闭(通常是这样),没有办法知道所使用的 PHP 版本 - 确实如此。运行什么 PHP 版本与外界无关,从安全角度来看,掩盖这一点是有好处的。Sometimes, PHP will emit a
X-Powered-By:
response header which you can look at e.g. using Firebug.If this setting (controlled by the ini setting
expose_php
) is turned off (it often is), there is no way to tell the PHP version used - and rightly so. What PHP version is running is none of the outside world's business, and it's good to obscure this from a security perspective.有一种令人惊讶的有效方法,包括使用 复活节彩蛋。
它们因版本而异。
There is a surprisingly effective way that consists of using the easter eggs.
They differ from version to version.
偶然:默认错误页面通常包含详细信息,例如
不太容易:找出服务器上运行的 PHP 应用程序版本以及它们需要哪个版本的 PHP。
另一种方法,只是为了完整性而提及;阅读后请忘记:您可以(但您不会!)通过尝试已知的漏洞来检测 PHP 版本。
By chance: Default error pages often contain detailed information, e.g.
Not so easy: Find out which versions of PHP applications run on the server and which version of PHP they require.
Another approach, only mentioned for the sake of completeness; please forget after reading: You could (but you won't!) detect the PHP version by trying known exploits.
我建议您更简单且独立于平台的解决方案 - 适用于 Google Chrome 的 wappalyzer:
参见此处
I suggest you much easier and platform independent solution to the problem - wappalyzer for Google Chrome:
See here
可能使用类似 firefox 的 tamperdata 的东西并查看返回的标头(如果它们启用了发布)。
Possibly use something like firefox's tamperdata and look at the header returned (if they have publishing enabled).
正如其他人已经提到的那样,可以通过开发人员工具检查浏览器中的“X-Powered-By”响应标头来找到其他域的 PHP 版本。如果它没有通过 php.ini 配置公开,除非您有权访问服务器,否则您无法获取它。
There is a possibility to find the PHP version of other domain by checking "X-Powered-By" response header in the browser through developer tools as other already mentioned it. If it is not exposed through the php.ini configuration there is no way you can get it unless you have access to the server.
由于提出这个问题时隐含 PHP 作为用于提取任何网站的 PHP 版本信息的工具,因此我认为该代码为该问题提供了一个可行的解决方案。
下面的类用于提取给定一组 cURL 参数 ($opts) 的标头。
当以下面代码中指定的形式提交 URL 时,将调用此类。
我确信代码和 cURL 选项可以改进,但这提供了一个工作 PHP 代码,用于提取允许提取 PHP 版本和其他信息的标头。 Helow 是示例输出:
我希望这段代码对某人有用并节省一些时间。
As this questions was asked with PHP implied as the tool to use to extract the PHP version information for any website, I felt that the code provides a working solution to the question.
The class below is used to extract the headers given a set of cURL parameters ($opts).
This class is called when a URL is submitted in the form specified in the code below.
I am sure that the code and cURL options can be improved but this provides a working PHP code for extracting the headers that allow the PHP version and other information to be extracted. Helow is a sample output:
I hope that this code is useful to someone and saves a bit of time.
你不能。原因之一是并非每个网站都使用 PHP。另一个原因是:即使有一些迹象表明可能使用 PHP(例如
.php
文件扩展名、一些“PHPSESSID”参数、X-Powered-By 标头包含“PHP”等的字段)这些信息可能会被欺骗,让您认为使用了 PHP。You can’t. One reason is that not every web site uses PHP. And another reason is: Even if there are some signs that PHP might be used (e.g.
.php
file name extension, some “PHPSESSID” parameter, X-Powered-By header field containing “PHP”, etc.) those information might be spoofed to let you think PHP is used.答案是:NMAP 程序
感谢您的关注...
另一种方法是通过此站点 (http://web-sniffer.net/) 获取 HTTP 标头
或用于获取 HTTP 标头的 firefox 附加组件...
最好的问候
THE ANSWER IS : NMAP PROGRAM
THANKS FOR YOUR ATTENTIONS ...
another way is getting HTTP Headers by this site (http://web-sniffer.net/)
or firefox add-on for getting HTTP Headers...
Best Regards