php-install Digest 22 Apr 2002 09:30:00 -0000 Issue 800
Topics (messages 6705 through 6707):
<?php ... ?> ignored by Apache
6705 by: R.J.Peach
6706 by: Rasmus Lerdorf
Installing PHP for command-line use
6707 by: webmaster
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hello.
First - This may well be a problem principally to do with apache,
but if so (it appears to be) specifically with apache/php interaction
so here goes....
I have been experimenting with apache 1.3.23 / php 4.1.2 for several weeks
now and have met with a problem that has me puzzled.
I have built Apache & php from source on linux and have elected to statically
bind php to apache (i.e. httpd -l reports mod_php4.c)
Om my local apache server, I can execute cgi-bin programs in C and perl perfectly well
to service POST requests from html pages.
I have access to a remote server, which also runs these cgi-bins correctly.
I also built the command line version of php - which executes simple php code
from the console.
php -i > info.html
produces an html page that (as far as I can see) is OK.
As far as I can tell, I have the necessary additions to httpd.conf to
recognise php mime types.
HOWEVER.
On both my local and on the remote server, attempts to execute
html with embedded <?php (or any other alternative to this) act as if
the server was treating the html inclusions as comments. Nothing is
produced in the displayed page from the php sections, but a `view source'
returns the page with the php code inclusions present . This happens on both my
local server and the remote one (which I understand) is also running
apache 1.3.23
On the local server, there are no error reports from either apache
or php in their respective logs.
I guess that apache is probably not even attempting to parse the html page,
and the browser will simply be silently ignoring unknown html tags.
If I am right about this, what then is likely to be missing from
(again a guess) my httpd.conf
Sound familiar to anyone eh?
Regards, RJP
<http://www/sedric.co.uk>
--- End Message ---
--- Begin Message ---
Did you configure Apache to treat .html files as PHP files? It sounds
like you are naming your files whatever.html but I bet you only configured
Apache to parse whatever.php.
Look for this line:
AddType application/x-httpd-php .php
And change it to:
AddType application/x-httpd-php .html
If you want Apache to parse normal .html files for PHP. Or put both .php
and .html there.
Don't forget to restart your server after making the change.
-Rasmus
On Sun, 21 Apr 2002, R.J.Peach wrote:
> Hello.
>
> First - This may well be a problem principally to do with apache,
> but if so (it appears to be) specifically with apache/php interaction
> so here goes....
>
> I have been experimenting with apache 1.3.23 / php 4.1.2 for several weeks
> now and have met with a problem that has me puzzled.
>
> I have built Apache & php from source on linux and have elected to statically
> bind php to apache (i.e. httpd -l reports mod_php4.c)
>
> Om my local apache server, I can execute cgi-bin programs in C and perl perfectly
>well
> to service POST requests from html pages.
>
> I have access to a remote server, which also runs these cgi-bins correctly.
>
> I also built the command line version of php - which executes simple php code
> from the console.
>
> php -i > info.html
> produces an html page that (as far as I can see) is OK.
>
> As far as I can tell, I have the necessary additions to httpd.conf to
> recognise php mime types.
>
> HOWEVER.
> On both my local and on the remote server, attempts to execute
> html with embedded <?php (or any other alternative to this) act as if
> the server was treating the html inclusions as comments. Nothing is
> produced in the displayed page from the php sections, but a `view source'
> returns the page with the php code inclusions present . This happens on both my
> local server and the remote one (which I understand) is also running
> apache 1.3.23
> On the local server, there are no error reports from either apache
> or php in their respective logs.
>
> I guess that apache is probably not even attempting to parse the html page,
> and the browser will simply be silently ignoring unknown html tags.
>
> If I am right about this, what then is likely to be missing from
> (again a guess) my httpd.conf
>
> Sound familiar to anyone eh?
>
> Regards, RJP
>
>
> <http://www/sedric.co.uk>
>
>
>
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi all,
working with my website I have ofund it would be practical to be able to run PHP from
the command-line.
This would be nice when it comes to writing "at"-jobs etc, where now I have to use
PERL. It would be so much easier to do that kind of work if I could just write it in
PHP.
I have heard this is possible, but I dont know how and honestly haven't been able to
find info on it; at least not on the php.net website.
Any suggestions?
Best regards,
Eivind
--- End Message ---