PHP installed
How can you tell if PHP is installed on a server?, its not my server its remote, i have ftp acess. I think it must as some of the sites hosted on this server use php, but whenever I try some PHP code nothing happens even a simple echo will not work.
Rich
[263 byte] By [
Rich2189] at [2007-11-19 20:34:05]

# 1 Re: PHP installed
How can you tell if PHP is installed on a server?
You can put a PHP file on it with the contents of...
<?php phpinfo(); ?>
This will return the PHP information.
...even a simple echo will not work.
That actually sounds like an error on the page. View the source after loading the PHP and see if the HTML is even parsed.
Even if PHP is not installed you will see your PHP text. If the page is showing up blank it has to be an error.
Any PHP written and read from the server will be returned as the PHP text if no PHP is installed. If PHP is installed, it will return the output of PHP and not the actual PHP commands.
# 2 Re: PHP installed
Here's the source from IE when the page is viewed.
<html>
</head>
<body>
<?php echo "Hello World"; ?>
</body>
</html>
The above produces a white screen.
Rich
# 3 Re: PHP installed
White screen huh? It looks okay and even runs okay. What does your PHP error log say? What does the source code look like? Why is head ended but not started?
# 4 Re: PHP installed
Here's the source from IE when the page is viewed.
If this means that the source you posted is a result of "View Sourcecode" in IE,
than it looks like php ist not installed.
You should ask the administrator of the server if php is installed or if you
should use special file endings for your php files like .php3 or .php4 aso (e.g. in apache you can configure the file endings to be parsed by php)
# 5 Re: PHP installed
But if PHP is not installed, shouldn't it actually display the PHP source instead of be completely white (blank)?
# 6 Re: PHP installed
White screen huh? It looks okay and even runs okay. What does your PHP error log say? What does the source code look like? Why is head ended but not started?
The source is like it is above with a few extra HTML meta tags, the head wasn't ended cause i missed it with my copy and paste :).
# 7 Re: PHP installed
But if PHP is not installed, shouldn't it actually display the PHP source instead of be completely white (blank)?Well the server is interpreting every file with a unknown ending as plain
text. Firefox and Opera are showing the plain text(the source code) in this
case, but IE interprets the file as html!
The reason why this page dosn't show something is that there is
nothing to show!<html>
</head>
<body>
<?php echo "Hello World"; ?>
</body>
</html>this code here will not result in a white page it will print out "Hello Rich2189" in bold if you call it from IE ("http://....../test.php")<html>
</head>
<body>
<?php echo "Hello World"; ?>
<b>Hello Rich2189</b>
</body>
</html>
# 8 Re: PHP installed
Oh duh. I can't believe I fell for that. I just naturally assumed he had more text below the PHP.
# 9 Re: PHP installed
but the file ending im using is .html not .php, so what is it that im doing wrong exactly?
Rich
# 10 Re: PHP installed
but the file ending im using is .html not .php, so what is it that im doing wrong exactly?
There is your whole problem. PHP has to be run with a PHP extension. Rename the file *.php and it will work if PHP is installed.
# 11 Re: PHP installed
:)
IE view source output
<html>
<!-- Generated by AceHTML Freeware http://freeware.acehtml.com -->
<!-- Creation date: 08/04/2006 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="Unregistered user">
<meta name="generator" content="AceHTML 5 Freeware">
</head>
<body>
Hello World
</body>
</html>
works now thanks people.
# 12 Re: PHP installed
You're welcome.
Thanks to you too, blueday54555 for clearing up my idiocy.