[php] How can I find the version of php that is running on a distinct domain name?

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;
?>

This question is related to php version domain-name

The answer is


By chance: Default error pages often contain detailed information, e.g.

Apache/{Version} ({OS}) {Modules} PHP/{Version} {Modules} Server at {Domain}

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.


Possibly use something like firefox's tamperdata and look at the header returned (if they have publishing enabled).


I use redbot, a great tool to see php version, but also many other useful infos like headers, encoding, keepalive and many more, try it on

http://redbot.org

I loveit !

I also upvote Neil answer : curl -I http://websitename.com


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.


I suggest you much easier and platform independent solution to the problem - wappalyzer for Google Chrome:

See here


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 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.


This works for me:

curl -I http://websitename.com

Which shows results like this or similar including the PHP version:

HTTP/1.1 200 OK
Date: Thu, 13 Feb 2014 03:40:38 GMT
Server: Apache
X-Powered-By: PHP/5.4.19
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: no-cache
Pragma: no-cache
Set-Cookie: 7b79f6f1623da03a40d003a755f75b3f=87280696a01afebb062b319cacd3a6a9; path=/
Content-Type: text/html; charset=utf-8

Note that if you receive this message:

HTTP/1.1 301 Moved Permanently

You may need to curl the www version of the website instead i.e.:

curl -I http://www.websitename.com

There is a surprisingly effective way that consists of using the easter eggs.

They differ from version to version.


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to version

Which TensorFlow and CUDA version combinations are compatible? How can the default node version be set using NVM? Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51 Which ChromeDriver version is compatible with which Chrome Browser version? How to find which version of TensorFlow is installed in my system? How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite? What does 'Unsupported major.minor version 52.0' mean, and how do I fix it? Find nginx version? How to check all versions of python installed on osx and centos How can I specify the required Node.js version in package.json?

Examples related to domain-name

Nginx 403 error: directory index of [folder] is forbidden Get The Current Domain Name With Javascript (Not the path, etc.) What is a regular expression which will match a valid domain name without a subdomain? PHP get domain name How can I find the version of php that is running on a distinct domain name? Linux command to translate DomainName to IP How to validate domain name in PHP?