Click to See Complete Forum and Search --> : Is this host running PHP?


iamlucky13
10-05-2006, 12:24 AM
I hope I'm not asking too obvious of a question here. It might take a while to get a response from the server administrator, so I thought I'd try here, too.

I'm doing some charity work for a church group and they want to collect some information online. I have an account on the server and have had no problem adding plain html or shtml files before. I tried a simple PHP test script, but my browser was served the source script unparsed. A Perl script also failed to parse.

Netcraft provided the following information about the server:

Apache/2.0.47 Unix mod_perl/1.99_09
Perl/v5.8.0 DAV/2 PHP/4.3.3RC1 mod_ssl/2.0.47
OpenSSL/0.9.7a

That appears to say PHP is running.

Is there any other way to test it? Anybody know how Netcraft gets this information in the first place? Is there a way to get information about the server either while logged in via SSH or by reading HTTP headers?

NogDog
10-05-2006, 12:30 AM
I don't know anything about netcraft, but if you upload/create a file with a ".php" filename suffix with just the following text....

<?php
phpinfo();
?>

....If you open that file from your browser and get a whole bunch of info about PHP, then PHP is up and running for your account. If all you see is the above code, then it probably is not.

Note that the server could have PHP installed, but your account might not be enabled to use it, depending on what hosting plan you purchased.

pcthug
10-05-2006, 04:12 AM
There is a PHP exploit that you can test from your browser, just append ?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 to the end of a given URL and if the page is PHP based a picture of a dog or php logo will load. Please note: if the expose_php option in the relative php.ini is disabled, the exploit will not show, even if PHP is available.

http://sourceforge.net/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
http://nadnerb.org/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42

iamlucky13
10-05-2006, 02:55 PM
Hmm...thanks for the suggestions. NogDog, I had already tried yours. Pcthug, thanks for the secret, but I'm afraid it doesn't help in this case. Could be fun for poking around out of curiousity, though.

PHP is clearly not executing scripts. I don't know if there is a setting that restricts the parsing of scripts in that web folder (and possibly able to be overridden via .htaccess) or if PHP simply isn't there. I am also still curious where netcraft.com polled the information they presented from, which suggests that PHP is running. I presume from an HTTP header, but I could find any clear instructions on how to read a header and check myself.

NogDog
10-05-2006, 05:07 PM
Best bet would be to contact the web host helpdesk or customer service and ask them, rather than guessing.