PHP code in the source

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
wbryan6
Forum Newbie
Posts: 22
Joined: Sat Feb 04, 2006 12:13 pm

PHP code in the source

Post by wbryan6 »

I currently have PHP 5 setup on Win x64 with Apache 2.0 and I'm having a problem with one page. No matter how simple I make the PHP code (eg.

Code: Select all

echo "Hello World";
), nothing ever executes. Further more, when I open the source code for the page I can see the php code in the source. Obviously there are some problems there... Does anyone have some advice to offer? Perhaps some settings to check in Apache? Incidentally, I do have an index.php page that works fine, just not any other page I try to setup. Thanks in advance.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

are you sure you have your php code wrapped with php tags like this:

Code: Select all

<?php
  echo "Hello World";
?>
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

I would guess that you don't have the module loaded for php.

you need a line like this in your httpd.conf

Code: Select all

LoadModule php5_module /PHP/php5apache2.dll
you also need to make sure you have your extensions mapped for php.
something like this:

Code: Select all

AddType application/x-httpd-php .php
edit: I didn't read carefully enough...it's only one page that's not working 8O doh!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

What are you using to edit your .php files? Some editors, especially on Macs, insert characters that PHP doesn't like.
wbryan6
Forum Newbie
Posts: 22
Joined: Sat Feb 04, 2006 12:13 pm

Post by wbryan6 »

I use PHPEdit 1.0. Haven't had any problems with it in the past (been using it exclusively for about 7-8 months).
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Do the files have execute permissions?
Post Reply