Page 1 of 1

Browser doesn't render PHP

PostPosted: 28. August 2011 19:54
by Perox
Hi all,

I had problems with turning on Apache but once I disabled IIS it started to work, now phpMyAdmin works, but if I load any .php file or a .html file with php code inside, the prowser doesn't render the PHP. If I put a .php file in the browser, with something like:

<php?
echo "Hello world!";
?>

It should render:

Hello world!

But instead it renders:

<php?
echo "Hello world!";
?>

As if it was a html file with the code as text in it. I am using Google Chrome.

Thanks

Re: Browser doesn't render PHP

PostPosted: 29. August 2011 02:16
by Sharley
Your php files need to be placed in the C:\xampp\htdocs folder in a default installation and opened using a URI like so:
http://localhost/yourfile.php

The Apache server needs to parse the php code so you can see the result as intended.

Best wishes.

Re: Browser doesn't render PHP

PostPosted: 29. August 2011 03:12
by Altrea
and php blocks should start with <?php not <php?

But someone who advertises with webdesign and code in his signature should really know that. So, thank you very much for your signature spam.

Re: Browser doesn't render PHP

PostPosted: 29. August 2011 09:23
by Perox
Altrea wrote:and php blocks should start with <?php not <php?

But someone who advertises with webdesign and code in his signature should really know that. So, thank you very much for your signature spam.


Sorry my mistake with <php? ;) You are right that it is <?php, but the word code in my signature doesn't have to mean PHP coding :P