Browser doesn't render PHP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Browser doesn't render PHP

Postby Perox » 28. August 2011 19:54

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
Last edited by Perox on 29. August 2011 09:24, edited 1 time in total.
Perox
 
Posts: 2
Joined: 28. August 2011 19:42

Re: Browser doesn't render PHP

Postby Sharley » 29. August 2011 02:16

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.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Browser doesn't render PHP

Postby Altrea » 29. August 2011 03:12

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.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8290
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Browser doesn't render PHP

Postby Perox » 29. August 2011 09:23

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
Perox
 
Posts: 2
Joined: 28. August 2011 19:42


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 45 guests

cron