Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2001 16:20:48 -0400 (EDT)
From:      Alexander V P <alex@big-blue.net>
To:        Mark Hughes <mark@dvdnews.co.uk>
Cc:        "Gerald T. Freymann" <freymann@eagle.ca>, freebsd-questions@FreeBSD.ORG
Subject:   Re: quick php/apache question re the tags
Message-ID:  <Pine.BSF.4.21.0110161618580.13602-100000@localhost>
In-Reply-To: <00bd01c1567f$81f24c60$cdeb1e3e@mark2>

next in thread | previous in thread | raw e-mail | index | archive | help
hi,
in httpd.conf add this:
 AddType application/x-httpd-php .html  
and after all the html files will be parsed as php. but, it's not such a
great idea if you have a lot of ordinary html on the server.
hth,
alex


On Tue, 16 Oct 2001, Mark Hughes wrote:

> > > I have a FreeBSD 4.3-Release box with:
> > >
> > > Apache/1.3.20
> > > PHP/4.0.6
> > > mod_perl/1.25
> > >
> > > If I call up this sample html file with a web browser, I get a blank
> page
> > > and a correct title:
> > >
> > > <html>
> > >     <head>
> > >         <title>Example</title>
> > >     </head>
> > >     <body>
> > >
> > >         <?php
> > >         echo "Hi, I'm a PHP script!";
> > >         ?>
> > >
> > >     </body>
> > > </html>
> > >
> > > But if I put the exact same code into a file called "text.php" the
> > results
> > > are what you'd expect.
> > >
> > > What am I missing in order to have php command in an html file and have
> > > then processed?
> >
> > Couple of possibilities - the file must have the extension .php to be
> > recognised by apache as php-parseable, and you must have the correct
> lines
> > in your httpd.conf file for apache for recognising php files and passing
> > them to php itself (althogouh I can't check for you right now exactly
> what
> > they should be - if you installed from ports they should be there
> already,
> > if you installed manually then you may need to add them - I'd imagine
> > www.php.net will have info on what it is you need to add).
> 
> Sorry, didn't read the question right there :+)
> 
> Let me try again...
> 
> What web browser are you using? It is possible that the browser is
> interpreting the <? as a tag that it doesn't understand, and if I remember
> correctly browsers are supposed to ignore completely tags that they don't
> understand, thus implementing it correctly would be not showing the <? tag
> or it's contents.
> 
> Mark
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0110161618580.13602-100000>