Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a remote server supports PHP?

Tags:

php

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

like image 712
sandalone Avatar asked May 17 '11 09:05

sandalone


People also ask

How do I know if my server supports PHP?

[yoursite].com/test. php. If you see the code as you entered it, then your website cannot run PHP with the current host. If your server supports PHP, you will see a list of all the PHP/SQL properties that are supported by the host.

What is remote control PHP?

"Remote Control" is a PHP class library that allows you to programically control a remote device via its CLI interface (usually via SSH or Telnet) or any other command via STDIN and STDOUT using Expect in an easy to use object oriented manner.


3 Answers

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
like image 143
Zoran Zaric Avatar answered Oct 01 '22 14:10

Zoran Zaric


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.

Read more at

  • php_logo_guid — Gets the logo guid and
  • expose_php ini setting

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.

like image 43
Gordon Avatar answered Oct 01 '22 12:10

Gordon


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:

enter image description here

like image 31
Darin Dimitrov Avatar answered Oct 01 '22 14:10

Darin Dimitrov