Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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; ?> 
like image 392
LostLord Avatar asked Jan 12 '11 17:01

LostLord


People also ask

How do you find out what version of PHP a site is running?

Check PHP Version by Running PHP Code The simplest method to determine the PHP version running on your website is executing a PHP file that contains the following code: <? php echo 'PHP version: ' . phpversion();

What PHP version is my Apache using?

php in the Web server document root (installdir/apache2/htdocs/ for Apache or installdir/nginx/html for NGINX). Make sure the Web server is running, open a browser and type http://localhost/phptest.php. You should then see a screen showing detailed information about the PHP version you are using and installed modules.


2 Answers

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 
like image 101
Neil Robertson Avatar answered Oct 02 '22 00:10

Neil Robertson


I use redbot, a great tool to see the PHP version, but also many other useful infos like headers, encoding, keepalive and many more.

Try it on

http://redbot.org

I love it!

I also up vote Neil's answer: curl -I http://websitename.com

like image 30
neofutur Avatar answered Oct 02 '22 01:10

neofutur