Mailing List Archive

Apache 2.4 and php
I'm going nowhere for what must be a small glitch. Ubuntu server
20.04LTS, Apache/2.4.41 (Ubuntu) using mpm_prefork behind Nginx proxy
server.

We use php 7.4 for many thousands of static pages that use e.g. <?php
include 'inc/tophead.html';?> giving us "<!DOCTYPE html> <html
lang="en"> <head>, css, js, etc" sent to clients. Always reliable,
production and backup machines delivering perfectly for many years.

Just built a sandbox (to start looking at Apache Solr) as an exact
replica of our production servers (but without letsencrypt), exact down
to every file, version, release, permission, owner, dot and comma as far
as I can see after hours of searching around.

The sandbox is delivering "raw text" <?php include 'inc/whatever';? >,
not the content of the included file. Log files give no clue -- apache
just "200" responses for the <body> text and images, but obviously not
the css, js, layout -- syslog, auth, nginx and php exactly the same as
on the production servers.

Suggestions, pointers, ideas would be warmly welcomed -- and save what's
left of my sanity ;=}

Many thanks,
Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache 2.4 and php [ In reply to ]
First off, I would suggest not using prefork and mod_php, unless traffic is
minimal and performance is not a concern. Nowadays, the scalable solution
is to use php-fpm, and use a threaded mpm like event.

Secondly, for your issue, you will need to look into the php logs as php is
generating the response.

On Tue, 5 Jul 2022 at 16:24, Paul <stormy22@stormy.ca> wrote:

>
> I'm going nowhere for what must be a small glitch. Ubuntu server
> 20.04LTS, Apache/2.4.41 (Ubuntu) using mpm_prefork behind Nginx proxy
> server.
>
> We use php 7.4 for many thousands of static pages that use e.g. <?php
> include 'inc/tophead.html';?> giving us "<!DOCTYPE html> <html
> lang="en"> <head>, css, js, etc" sent to clients. Always reliable,
> production and backup machines delivering perfectly for many years.
>
> Just built a sandbox (to start looking at Apache Solr) as an exact
> replica of our production servers (but without letsencrypt), exact down
> to every file, version, release, permission, owner, dot and comma as far
> as I can see after hours of searching around.
>
> The sandbox is delivering "raw text" <?php include 'inc/whatever';? >,
> not the content of the included file. Log files give no clue -- apache
> just "200" responses for the <body> text and images, but obviously not
> the css, js, layout -- syslog, auth, nginx and php exactly the same as
> on the production servers.
>
> Suggestions, pointers, ideas would be warmly welcomed -- and save what's
> left of my sanity ;=}
>
> Many thanks,
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: Apache 2.4 and php [ In reply to ]
On 2022-07-06 08:27, Frank Gingras wrote:
> First off, I would suggest not using prefork and mod_php, unless traffic is
> minimal and performance is not a concern. Nowadays, the scalable solution
> is to use php-fpm, and use a threaded mpm like event.

Many thanks. Point well taken, on my "to do" list for a long time. My
only excuse: the production server is very stable, rarely even
approaches 10^6 hits a day, and whispers along quite nicely on 32 (64t)
cores - uptime currently at 326 days. What I need to do is to use the
sandbox (subject of this thread) to delve into Apache Solr. I am just
astounded that a mirror copy is failing abjectly.
>
> Secondly, for your issue, you will need to look into the php logs as php is
> generating the response.

There is absolutely nothing in the php logs -- I get the impression that
the Apache back end is just not calling the php includes. The site
itself was rsynced from production, everything else looks "forensically"
identical. Maybe I'll just rebuild it again from scratch, as I may have
made some sort of mistake somewhere, the order of installing the various
elements, whatever...

Again thanks -- Paul
>
> On Tue, 5 Jul 2022 at 16:24, Paul <stormy22@stormy.ca> wrote:
>
>>
>> I'm going nowhere for what must be a small glitch. Ubuntu server
>> 20.04LTS, Apache/2.4.41 (Ubuntu) using mpm_prefork behind Nginx proxy
>> server.
>>
>> We use php 7.4 for many thousands of static pages that use e.g. <?php
>> include 'inc/tophead.html';?> giving us "<!DOCTYPE html> <html
>> lang="en"> <head>, css, js, etc" sent to clients. Always reliable,
>> production and backup machines delivering perfectly for many years.
>>
>> Just built a sandbox (to start looking at Apache Solr) as an exact
>> replica of our production servers (but without letsencrypt), exact down
>> to every file, version, release, permission, owner, dot and comma as far
>> as I can see after hours of searching around.
>>
>> The sandbox is delivering "raw text" <?php include 'inc/whatever';? >,
>> not the content of the included file. Log files give no clue -- apache
>> just "200" responses for the <body> text and images, but obviously not
>> the css, js, layout -- syslog, auth, nginx and php exactly the same as
>> on the production servers.
>>
>> Suggestions, pointers, ideas would be warmly welcomed -- and save what's
>> left of my sanity ;=}
>>
>> Many thanks,
>> Paul
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache 2.4 and php [ In reply to ]
Paul,

httpd does not call php includes, period. This is processed by php alone.

On Wed, 6 Jul 2022 at 18:31, Paul <stormy22@stormy.ca> wrote:

> On 2022-07-06 08:27, Frank Gingras wrote:
> > First off, I would suggest not using prefork and mod_php, unless traffic
> is
> > minimal and performance is not a concern. Nowadays, the scalable solution
> > is to use php-fpm, and use a threaded mpm like event.
>
> Many thanks. Point well taken, on my "to do" list for a long time. My
> only excuse: the production server is very stable, rarely even
> approaches 10^6 hits a day, and whispers along quite nicely on 32 (64t)
> cores - uptime currently at 326 days. What I need to do is to use the
> sandbox (subject of this thread) to delve into Apache Solr. I am just
> astounded that a mirror copy is failing abjectly.
> >
> > Secondly, for your issue, you will need to look into the php logs as php
> is
> > generating the response.
>
> There is absolutely nothing in the php logs -- I get the impression that
> the Apache back end is just not calling the php includes. The site
> itself was rsynced from production, everything else looks "forensically"
> identical. Maybe I'll just rebuild it again from scratch, as I may have
> made some sort of mistake somewhere, the order of installing the various
> elements, whatever...
>
> Again thanks -- Paul
> >
> > On Tue, 5 Jul 2022 at 16:24, Paul <stormy22@stormy.ca> wrote:
> >
> >>
> >> I'm going nowhere for what must be a small glitch. Ubuntu server
> >> 20.04LTS, Apache/2.4.41 (Ubuntu) using mpm_prefork behind Nginx proxy
> >> server.
> >>
> >> We use php 7.4 for many thousands of static pages that use e.g. <?php
> >> include 'inc/tophead.html';?> giving us "<!DOCTYPE html> <html
> >> lang="en"> <head>, css, js, etc" sent to clients. Always reliable,
> >> production and backup machines delivering perfectly for many years.
> >>
> >> Just built a sandbox (to start looking at Apache Solr) as an exact
> >> replica of our production servers (but without letsencrypt), exact down
> >> to every file, version, release, permission, owner, dot and comma as far
> >> as I can see after hours of searching around.
> >>
> >> The sandbox is delivering "raw text" <?php include 'inc/whatever';? >,
> >> not the content of the included file. Log files give no clue -- apache
> >> just "200" responses for the <body> text and images, but obviously not
> >> the css, js, layout -- syslog, auth, nginx and php exactly the same as
> >> on the production servers.
> >>
> >> Suggestions, pointers, ideas would be warmly welcomed -- and save what's
> >> left of my sanity ;=}
> >>
> >> Many thanks,
> >> Paul
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >> For additional commands, e-mail: users-help@httpd.apache.org
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: Apache 2.4 and php [ In reply to ]
Paul,

You should respond to the list, so that other folks can benefit from the
answers.

Now, you embedded php code in .html files, which is a very bad idea, as you
now have to use the php module to parse every single html file. I recommend
that you not do that.

On Wed, 6 Jul 2022 at 21:34, Frank Gingras <thumbs@apache.org> wrote:

> Paul,
>
> httpd does not call php includes, period. This is processed by php alone.
>
> On Wed, 6 Jul 2022 at 18:31, Paul <stormy22@stormy.ca> wrote:
>
>> On 2022-07-06 08:27, Frank Gingras wrote:
>> > First off, I would suggest not using prefork and mod_php, unless
>> traffic is
>> > minimal and performance is not a concern. Nowadays, the scalable
>> solution
>> > is to use php-fpm, and use a threaded mpm like event.
>>
>> Many thanks. Point well taken, on my "to do" list for a long time. My
>> only excuse: the production server is very stable, rarely even
>> approaches 10^6 hits a day, and whispers along quite nicely on 32 (64t)
>> cores - uptime currently at 326 days. What I need to do is to use the
>> sandbox (subject of this thread) to delve into Apache Solr. I am just
>> astounded that a mirror copy is failing abjectly.
>> >
>> > Secondly, for your issue, you will need to look into the php logs as
>> php is
>> > generating the response.
>>
>> There is absolutely nothing in the php logs -- I get the impression that
>> the Apache back end is just not calling the php includes. The site
>> itself was rsynced from production, everything else looks "forensically"
>> identical. Maybe I'll just rebuild it again from scratch, as I may have
>> made some sort of mistake somewhere, the order of installing the various
>> elements, whatever...
>>
>> Again thanks -- Paul
>> >
>> > On Tue, 5 Jul 2022 at 16:24, Paul <stormy22@stormy.ca> wrote:
>> >
>> >>
>> >> I'm going nowhere for what must be a small glitch. Ubuntu server
>> >> 20.04LTS, Apache/2.4.41 (Ubuntu) using mpm_prefork behind Nginx proxy
>> >> server.
>> >>
>> >> We use php 7.4 for many thousands of static pages that use e.g. <?php
>> >> include 'inc/tophead.html';?> giving us "<!DOCTYPE html> <html
>> >> lang="en"> <head>, css, js, etc" sent to clients. Always reliable,
>> >> production and backup machines delivering perfectly for many years.
>> >>
>> >> Just built a sandbox (to start looking at Apache Solr) as an exact
>> >> replica of our production servers (but without letsencrypt), exact down
>> >> to every file, version, release, permission, owner, dot and comma as
>> far
>> >> as I can see after hours of searching around.
>> >>
>> >> The sandbox is delivering "raw text" <?php include 'inc/whatever';? >,
>> >> not the content of the included file. Log files give no clue -- apache
>> >> just "200" responses for the <body> text and images, but obviously not
>> >> the css, js, layout -- syslog, auth, nginx and php exactly the same as
>> >> on the production servers.
>> >>
>> >> Suggestions, pointers, ideas would be warmly welcomed -- and save
>> what's
>> >> left of my sanity ;=}
>> >>
>> >> Many thanks,
>> >> Paul
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> >> For additional commands, e-mail: users-help@httpd.apache.org
>> >>
>> >>
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
Re: Apache 2.4 and php [ In reply to ]
On 2022-07-06 21:34, Frank Gingras wrote:
> Paul,
>
> httpd does not call php includes, period. This is processed by php alone.

Frank, thanks, perhaps my poor choice of words. I had this in mind:

paul@sandbox:/etc/apache2/mods-enabled$ cat php7.4.load
# Conflicts: php5
# Depends: mpm_prefork
LoadModule php7_module /usr/lib/apache2/modules/libphp7.4.so

and see this as the "start" of processing the included text files:

paul@sandbox:/www/testsolr$ cat index.html
<?php include 'inc/tophead.html';?>
<title>Test Solr</title>
<?php include 'inc/mainhead.html';?>
/..../

So, apologies for "call", but do you or others have a suggestion as to
why this works on one box, and not on a mirror image?

Many thanks -- Paul

>
> On Wed, 6 Jul 2022 at 18:31, Paul <stormy22@stormy.ca> wrote:
>
>> On 2022-07-06 08:27, Frank Gingras wrote:
>>> First off, I would suggest not using prefork and mod_php, unless traffic
>> is
>>> minimal and performance is not a concern. Nowadays, the scalable solution
>>> is to use php-fpm, and use a threaded mpm like event.
>>
>> Many thanks. Point well taken, on my "to do" list for a long time. My
>> only excuse: the production server is very stable, rarely even
>> approaches 10^6 hits a day, and whispers along quite nicely on 32 (64t)
>> cores - uptime currently at 326 days. What I need to do is to use the
>> sandbox (subject of this thread) to delve into Apache Solr. I am just
>> astounded that a mirror copy is failing abjectly.
>>>
>>> Secondly, for your issue, you will need to look into the php logs as php
>> is
>>> generating the response.
>>
>> There is absolutely nothing in the php logs -- I get the impression that
>> the Apache back end is just not calling the php includes. The site
>> itself was rsynced from production, everything else looks "forensically"
>> identical. Maybe I'll just rebuild it again from scratch, as I may have
>> made some sort of mistake somewhere, the order of installing the various
>> elements, whatever...
>>
>> Again thanks -- Paul
>>>
>>> On Tue, 5 Jul 2022 at 16:24, Paul <stormy22@stormy.ca> wrote:
>>>
>>>>
>>>> I'm going nowhere for what must be a small glitch. Ubuntu server
>>>> 20.04LTS, Apache/2.4.41 (Ubuntu) using mpm_prefork behind Nginx proxy
>>>> server.
>>>>
>>>> We use php 7.4 for many thousands of static pages that use e.g. <?php
>>>> include 'inc/tophead.html';?> giving us "<!DOCTYPE html> <html
>>>> lang="en"> <head>, css, js, etc" sent to clients. Always reliable,
>>>> production and backup machines delivering perfectly for many years.
>>>>
>>>> Just built a sandbox (to start looking at Apache Solr) as an exact
>>>> replica of our production servers (but without letsencrypt), exact down
>>>> to every file, version, release, permission, owner, dot and comma as far
>>>> as I can see after hours of searching around.
>>>>
>>>> The sandbox is delivering "raw text" <?php include 'inc/whatever';? >,
>>>> not the content of the included file. Log files give no clue -- apache
>>>> just "200" responses for the <body> text and images, but obviously not
>>>> the css, js, layout -- syslog, auth, nginx and php exactly the same as
>>>> on the production servers.
>>>>
>>>> Suggestions, pointers, ideas would be warmly welcomed -- and save what's
>>>> left of my sanity ;=}
>>>>
>>>> Many thanks,
>>>> Paul
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache 2.4 and php [ In reply to ]
Does it work if you rename index.html to index.php ?


On 2022-07-07 13:05, Stormy-SDLU wrote:
> On 2022-07-06 21:34, Frank Gingras wrote:
>> Paul,
>>
>> httpd does not call php includes, period. This is processed by php
>> alone.
>
> Frank, thanks, perhaps my poor choice of words. I had this in mind:
>
> paul@sandbox:/etc/apache2/mods-enabled$ cat php7.4.load
> # Conflicts: php5
> # Depends: mpm_prefork
> LoadModule php7_module /usr/lib/apache2/modules/libphp7.4.so
>
> and see this as the "start" of processing the included text files:
>
> paul@sandbox:/www/testsolr$ cat index.html
> <?php include 'inc/tophead.html';?>
>     <title>Test Solr</title>
> <?php include 'inc/mainhead.html';?>
> /..../
>
> So, apologies for "call", but do you or others have a suggestion as to
> why this works on one box, and not on a mirror image?
>
> Many thanks -- Paul

--
David Copeland
JSI Data Systems Limited
613-727-9353
www.jsidata.ca


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache 2.4 and php [ In reply to ]
On Thu, Jul 7, 2022 at 1:06 PM Stormy-SDLU <stormy22@stormy.ca> wrote:
>
> On 2022-07-06 21:34, Frank Gingras wrote:
> > Paul,
> >
> > httpd does not call php includes, period. This is processed by php alone.
>
> Frank, thanks, perhaps my poor choice of words. I had this in mind:
>
> paul@sandbox:/etc/apache2/mods-enabled$ cat php7.4.load
> # Conflicts: php5
> # Depends: mpm_prefork
> LoadModule php7_module /usr/lib/apache2/modules/libphp7.4.so

Don't you need something additional like SetHandler or
SetOutputFilter/AddOutputFilterByType to tell this module to do
anything against certain URLs?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org