Reputation: 41759
I often have clients who do not know if their server supports PHP (their website is HTML web site). At the moment, I send them hello.php file, they upload it and then I check it remotely if their server supports PHP. As you see this takes day or two and it's just a waste of time.
Can I myself any how check if their server supports PHP (via web browser or console tool)? If the domain is for example www.my-client.com, what would be the syntax?
Thanks
PS. I have an access to Linux console so I could use it as well
Upvotes: 10
Views: 13032
Reputation: 317119
Can also try with
http://www.example.com/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
Some servers will respond with a PHP image then. If you have shell access, it is more reliable to test whether php in installed directly on the system though. Whether PHP exposes if it is installed via this Easter Egg or via the Response Headers can be disabled in the PHP.ini.
Decides whether PHP may expose the fact that it is installed on the server (e.g. by adding its signature to the Web server header). It is no security threat in any way, but it makes it possible to determine whether you use PHP on your server or not.
Upvotes: 5
Reputation: 23264
Not very reliable (but a quick check) is requesting a non existing path (404) returns information about the server and its setup. For example, on my machine I get the following in the footer which I could parse for 'PHP':
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1
Upvotes: 3
Reputation: 1221
As Darin Dimitrov says some Servers promote the versions of the uses software. You can use curl to view the HTTP Header of a response.
> curl -I http://example.com
HTTP/1.1 200 OK
Date: Tue, 17 May 2011 10:04:01 GMT
Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch
X-Powered-By: PHP/5.2.4-2ubuntu5.10
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Upvotes: 9
Reputation: 10467
In addition to Darin Dimitrov's answer I can say that you could read WHOIS information about the domain and detect where it is being hosted. Then, if you identify the hoster, simply check what features he offers.
Upvotes: 1
Reputation: 1039130
The best you could do is send an HTTP request to this server http://www.my-client.com
and inspect response HTTP headers. In some cases depending on the server there might be clues. For example here's how the response HTTP headers look like in FireBug for http://joomla.org:
Upvotes: 7