faqts : Computers : Programming : Languages : PHP : Function Libraries : PHP Related

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

5 of 5 people (100%) answered Yes
Recently 5 of 5 people (100%) answered Yes


How do I test that a remoter server has php working?

Feb 18th, 2005 21:03
Devis Lucato, Stoyan Stefanov, Rob Rae,

You can use the server response header and look for PHP in it.
Here's how a sample response looks like:
HTTP/1.x 301 Moved Permanently
Date: Fri, 11 Feb 2005 17:06:09 GMT
Server: Apache/1.3.26 (Unix) mod_gzip/ PHP/4.3.3-dev
Location: http://www.php.net/
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
As you can see this server says it's running php 4.3.3.
Disclaimer - this is not 100% accurate since the server may not report
correctly whether or not it's running php.
Now how to get this server response?
1) Just install the Live HTTP headers extension for Firefox.
2) Isn't there an easier way?
Yes, there is. Just go to netcraft.com and use the "What's this server
running?" tool located on the top left.
3) You can also telnet the server on port 80 to have this answer, open a
shell and write "telnet www.yoursite.com 80" then after the connection
write "GET / HTTP 1.1", you should get something like this:
HTTP/1.1 400 Bad Request
Date: Sat, 19 Feb 2005 10:05:39 GMT
Server: Apache/1.3.31 (Win32) PHP/4.3.8
Connection: close
Content-Type: text/html; charset=iso-8859-1
where you can view PHP version.
Anyway if you don't see the version in this ways it means the server
administrator has hidden the information. Then you can write him to ask
what you need.