In article <ypudnTD-adgr8_DVnZ2dnUVZ_rjinZ2d@[EMAIL PROTECTED]
>,
Hamad bin Turki al Salami <hamad@[EMAIL PROTECTED]
> wrote:
> I enabled apache web server and php on an OSX leopard server
> by:
> enabling Web Sharing in Preferences
> uncommenting
> LoadModule php5_module ...
> in httpd.conf
>
> I also created a php.ini file.
>
> When I serve a file with .php extension, everything works fine. However,
> if I serve an .html file with embedded php tags, the tags aren't
> executed. For instance, serving a page with:
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <?php phpinfo(); ?>
> </body>
> </html>
>
>
>
> gives a blank page.
>
>
> Is there something else I need to do to get embedded php tags to work?
Rename the file to index.php and it will give corectly interpet the file
as php.
All of what you've done is correct up until you created the index.html
file. That will _always_ be interpreted as HTML rather than PHP.
There's no way around this. It's just the way Apache works. Lots of
people in the php newsgroups complain they can't get Apache to interpret
..html or .htm files as php.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically by
ignored]


|