Re: PHP4/Apache: .php files OK, <?php fails
| From: | Nat Sakimura | Date: | Sun, 07 Jan 2001 15:42:13 +0000 |
| Subject: | Re: PHP4/Apache: .php files OK, <?php fails | ||
| References: | 1 2 3 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-1488@lists.php.net to get a copy of this message | ||
That's what I am pointing out.
Either
(1) Change the extention from .htm to .php
or
(2) add .htm to AddType application/x-httpd-php line
in httpd.conf so that .htm extention will actually be
processed by mod_php.
Regards,
Nat Sakimura
----- Original Message -----
From: "bill" <bmoore@mooreinternet.com>
To: "Nat Sakimura" <sakimura@gosoudan.com>
Sent: Monday, January 08, 2001 12:39 AM
Subject: Re: [PHP-INST] PHP4/Apache: .php files OK, <?php
fails
> In your .htm file you have php inline code. Therefore if
you wish it to be
> processed by the php interpreter, you must change the
extension name from
> .htm to .php
>
> Hope this helps.
>
> Bill Moore
> http://www.biz-webhost.com
>
> ----- Original Message -----
> From: "Nat Sakimura" <sakimura@gosoudan.com>
> To: "The Big Ugly" <terry@uglysoftware.com>
> Cc: <php-install@lists.php.net>
> Sent: Sunday, January 07, 2001 9:28 AM
> Subject: Re: [PHP-INST] PHP4/Apache: .php files OK, <?php
fails
>
>
> > I am not sure if I am getting it correctly, but
> > what you have to do probably is to write the page
> > with .php extention or to add the .htm to
> > AddType application/x-httpd-php
> > line in httpd.conf .
> >
> > Regards,
> >
> > Nat Sakimura
> >
> > ----- Original Message -----
> > From: "The Big Ugly" <terry@uglysoftware.com>
> > To: <php-install@lists.php.net>
> > Sent: Sunday, January 07, 2001 8:13 PM
> > Subject: Re: [PHP-INST] PHP4/Apache: .php files OK,
<?php
> > fails
> >
> >
> > > Sorry to reply to my own post, but if anyone wants to
take
> > a look at my
> > > web site, the problem code is demonstrated on the main
> > page:
> > >
> > > http://www.uglysoftware.com
> > >
> > > There's an inline script, which does nothing, and a
link
> > to a separate
> > > .php file, which works correctly.
> > >
> > > Thanks for any help!
> > >
> > > Terry McKiernan
> > > Ugly Software
> > >
> > > On Sun, 7 Jan 2001, The Big Ugly wrote:
> > >
> > > > I just installed PHP 4.0.4 on Apache 1.3.14 running
on
> > RH Linux 7.0 (i386)
> > > > and it's all looking pretty good, except that the
inline
> > <?php tags don't
> > > > work. A file ending in .php is recognized just fine
by
> > Apache and
> > > > executed properly.
> > > >
> > > > That is, if I write a little PHP script and put it
in a
> > file with
> > > > extension .php, and load that into my browser, then
it
> > runs just like it
> > > > should.
> > > >
> > > > If I have an HTML file with some of what I'll call
> > "inline" PHP, using the
> > > > <?php ?> construct, the server & browser completely
> > ignore it. I can view
> > > > the page source and see the PHP code; it is just
getting
> > ignored as if it
> > > > were an unknown HTML tag.
> > > >
> > > > For example, this (test1.htm) does not work:
> > > >
> > > > <html>
> > > > <head><title>Inline PHP</title><head>
> > > > <body>
> > > > Some stuff before the PHP<br>
> > > > <?php echo("a line printed by PHP"); ?><br>
> > > > </body>
> > > > </html>
> > > >
> > > > All I get in the browser is the "Some stuff before
the
> > PHP" line.
> > > >
> > > > This, on the other hand, does work when saved as
> > test2.php and loaded
> > > > into the browser:
> > > >
> > > > <?php
> > > > $html = <<<ENDH
> > > > <html>
> > > > <head><title>PHP from Script</title></head>
> > > > <body>
> > > > <h1>Groovy PHP</h1>
> > > > </body>
> > > > </html>
> > > > ENDH;
> > > > echo $html;
> > > > ?>
> > > >
> > > >
> > > > So, I'm mystified. PHP and Apache seem to be
talking
> > together to some
> > > > extent, since the .php files work. Is there
something I
> > need to do to
> > > > enable the <?php ?> tags? I have tried the short <?
?>
> > and long <script
> > > > language="php"> variations with the same results.
> > > >
> > > > Thanks for any help!
> > > >
> > > > Terry McKiernan
> > > > Ugly Software
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP Install Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail:
> > php-install-unsubscribe@lists.php.net
> > > For additional commands, e-mail:
> > php-install-help@lists.php.net
> > > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> > >
> > >
> >
> >
> > --
> > PHP Install Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
php-install-unsubscribe@lists.php.net
> > For additional commands, e-mail:
php-install-help@lists.php.net
> > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> >
>
>