Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can't imagine this is possible but maybe there's some novel way. I'm developing an app which will require a few php files to be deployed and run on the clients' webservers. I'm not particularly interested in targeting clients who are still running pre version 5 versions of PHP.

So is there any way one can tell which version of PHP a remote webserver has running?

share|improve this question
add comment

4 Answers 4

up vote 3 down vote accepted

You can use a site to view http headers such as http://web-sniffer.net/

Some sites will return the PHP version in the server section of the header for example here's a response from a site I just tested:

Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 
mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.12

This is more likely to work on sites hosted on a standard shared hosting platform such as cPanel.

share|improve this answer
    
Also did the job. Didn't expect so many responses but I'll give you the tick as I re-install my development environment quite often and a website means one less tool to download. –  jontyc May 10 '11 at 11:09
add comment

Many servers provide an X-Powered-By header which might include the PHP version. Try querying the server with curl:

curl -I http://example.com
share|improve this answer
    
Worked great on the few sites I tried. Thanks. I'll vote your answer up when I reach enough points to do so. –  jontyc May 10 '11 at 11:10
add comment

You can olso view X-Powered-By header using some browser add-ons, for example "Live HTTP Headers" add-on to Mozilla Firefox. However most production servers doesn't include X-Powered-By header.

share|improve this answer
    
I'll keep it in mind. I'll vote your answer up when I reach enough points to do so. Thanks. –  jontyc May 10 '11 at 11:08
add comment

In fiddler, go to the compose tab and type in the web address and send a GET request. Then when the response pops up in the left window, double click on it. On the right side it'll showt he request and response details. In the response details (bottom right), click the RAW or HEADERS tab and take a look at the headers. The server info will be next to the Server: header

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.