Page 1 of 1

php not executed

PostPosted: 06. May 2013 23:51
by patrick76
I'm having the same problem, KeepSmiling. I installed xampp today. I started Apache and MySQL from the xampp control panel. phpMyAdmin comes up just fine. However I can't get even a simple Hello World php file to work. The web browser shows a blank screen.

Here is the complete text as viewed in Chrome page source:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
   echo "Hello World";
   ?>
   
</body>
</html>


[edit by Altrea: splitted from the original thread. One thread per unique user and issue rule]

Re: php not executed

PostPosted: 07. May 2013 00:00
by Altrea
Hi patrick76,

The most common "php don't get parsed issues":
  • Using short_open_tag
  • wrong Browser request (file:// instead of http:// protocol)
  • File extension .html instead of .php
  • wrong encoding (UTF8 with instead of without ByteOrderMark, UCS2 or other Multibyte- or other non-ANSI character encodings)

best wishes,
Altrea

Re: php not executed

PostPosted: 07. May 2013 00:25
by patrick76
It was the 2nd one. At least that gets Hello World working now, so I'm in business. Thanks, Altrea!

Re: php not executed

PostPosted: 07. May 2013 00:39
by Altrea
You are welcome :D
Have fun with XAMPP and all that stuff 8)