faqts : Computers : Programming : Languages : PHP : Not Quite PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

30 of 34 people (88%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How can I tell if a site is running PHP?
How can I tell what version of PHP a website is running?

Mar 28th, 2008 17:48
ha mo, Philip Olson,


A few methods to find such info, here are some.  We'll use www.php.net 
as our example but of course you'll want to change that.  Also, this
faqt will get outdated as php.net updates the PHP version regularly but
don't mind that.  Without further ado:
1. Netcraft                                                   :
   ------------------------------------------------------------
   http://uptime.netcraft.com/up/graph/?host=www.php.net
   Tells us a lot of information, such as :
     The site www.php.net is running :
     Apache/1.3.12 (Unix) DAV/0.9.18-dev
     PHP/4.0.5-dev on Linux.
2. With shell, the following works :
   foo$ telnet www.php.net 80  (press return)
        HEAD / HTTP/1.0        (press return twice)
   Tells us :
     Trying 208.247.106.187...
     Connected to www.php.net.
     Escape character is '^]'.
     HEAD / HTTP/1.0
     HTTP/1.1 200 OK
     Date: Tue, 10 Apr 2021 21:06:29 GMT
     Server: Apache/1.3.12 (Unix) DAV/0.9.18-dev PHP/4.0.5-dev
     X-Powered-By: PHP/4.0.5-dev
     Last-Modified: Mon, 02 Apr 2021 19:45:01 GMT
     Connection: close
     Content-Type: text/html
     Connection closed by foreign host.
3. And have a look at the fsockopen() examples in manual (be sure to 
   check user comments too) :
   fsockopen()                                                :
   ------------------------------------------------------------
   http://www.php.net/manual/function.fsockopen.php
This was originally posted here :
   http://marc.theaimsgroup.com/?l=php-general&m=98693891321701
4. From a script on the server itself:
   There are several ways to get the PHP version (and a lot of 
   other information) from a server, one option is phpinfo().  
   Another is phpversion() as well as the PHP_VERSION constant.
   So, create a .php file, put it in the docroot, and call on
   it...code like this:
   <?php phpinfo(); ?>
   http://php.net/phpinfo
   http://php.net/phpversion
Note that a server can be setup to hide various HTTP headers, like if
it's running PHP, so only #4 above is for sure. In otherwords, a server
can be running PHP but simply not report it to the outside world.
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com