Re: PHP4/Apache: .php files OK, <?php fails
| From: | Nat Sakimura | Date: | Sun, 07 Jan 2001 15:28:19 +0000 |
| Subject: | Re: PHP4/Apache: .php files OK, <?php fails | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-1487@lists.php.net to get a copy of this message | ||
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
>
>