Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Systems > Re: Getting emb...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 24329 of 25209
Post > Topic >>

Re: Getting embedded PHP to work with Apache on OSX

by Michael Vilain <vilain@[EMAIL PROTECTED] > Jul 4, 2008 at 01:29 AM

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]
 




 6 Posts in Topic:
Getting embedded PHP to work with Apache on OSX
Hamad bin Turki al Salami  2008-07-03 18:28:32 
Re: Getting embedded PHP to work with Apache on OSX
Tom Stiller <tomstille  2008-07-04 02:24:14 
Re: Getting embedded PHP to work with Apache on OSX
Hamad bin Turki al Salami  2008-07-04 11:35:40 
Re: Getting embedded PHP to work with Apache on OSX
Michael Vilain <vilain  2008-07-04 01:29:43 
Re: Getting embedded PHP to work with Apache on OSX
Marko Vihoma <marko@[E  2008-07-04 08:56:18 
Re: Getting embedded PHP to work with Apache on OSX
Sander Tekelenburg <us  2008-07-04 20:40:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 8:45:04 CST 2008.