PHP Apache 2 Mac OS X

This is probably really simple, but I can't find a targeted answer in the archives.  I am a neophyte on running a web server, but I have Apache 2, PHP 5, MySQL, etc running happily on MacOS X 10.3.9.  Here is the problem.  If I embed a PHP script in an HTML document like so:

<HTML>
<HEAD>
</HEAD>
<BODY>
This is html
<?php
print ("This is php\n");
?>
</BODY>
</HTML>

the server does not seem to understand the script; it just sends out the php source text as if it were part of the html.  In my httpd.conf, I have the following statements:

LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php

I can't figure out what is missing here.  If  I just browse a file foo.php with a php script in it, it works happily, but the same script embedded in html does not work. Anyone got any ideas?
Thanks

JEH
harlowAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ThomasFrankeCommented:
What is the extension of your script?
It has to be .php

.html is just read from the file and sent to the browser as it is. There is no processing of .html-files.
If you want your script to be handled and processed by php it has to have the .php extension.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
harlowAuthor Commented:
I have been following the text and examples in "PHP for the World Wide Web" by Larry Ullman, Peachpit Press, 2001. Here is a very simple example script that he gives in the boook; its name is script_1_3.php:

<HTML>
<HEAD>
<TITLE>First PHP Script</TITLE>
</HEAD>
<BODY>
<?PHP
print ("Hello, world!");
?>
</BODY>
</HTML>

You are right on the money: I was using a .html extension on this kind of file.  When I make it .php, it works fine.

Thanks!

JEH
ThomasFrankeCommented:
Glad it works ;-)

Have fun coding
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.