How to make phpbb work on Redhat 8.0 (Apache2 + PHP4)!

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
drakon
Registered User
Posts: 11
Joined: Fri Aug 09, 2002 4:35 pm
Location: Buenos Aires - Argentina
Contact:

Post by drakon »

Thanks hexoplastia, you did saved me too.
allan
Registered User
Posts: 10
Joined: Tue May 28, 2002 9:24 pm
Location: surreal city, usa
Contact:

Post by allan »

I did it the other way - removed Apache 2.0 and reinstalled Apache 1.3.

Fortunately the RH8 update saved my old httpd.conf :)
sugapablo
Registered User
Posts: 6
Joined: Tue Nov 19, 2002 2:12 pm

Re: Another solution

Post by sugapablo »

hexoplastia wrote: I'm not running RH8, but RH7.1.
I'm running Apache 2.0.39 and PHP 4.2.2, but I'm sure that it will work on later versions.

I've had the same ridiculous problem with the browser-caching, I've solved it by adding some META TAGS to my overall_header and overall_footer HTML files in my style's template. (Yes, META TAGS in overall_footer too!)


Worked great. Very clear. Thanks :)
Oda
Registered User
Posts: 9
Joined: Fri Aug 30, 2002 5:31 am

Post by Oda »

Does anyone follow apache.org or php.org to know whether or not a fix is on the way for this? It affects a lot more than phpbb. Apache 2.0 has been around for a long time. You'd think that it would have been released with compatibility issues already solved considering it's one of the world's most popular webservers.
allan
Registered User
Posts: 10
Joined: Tue May 28, 2002 9:24 pm
Location: surreal city, usa
Contact:

Post by allan »

php 4.3.0RC1 was just released. Although some people say that Apache 2.0.42 fixes the problem we're talking about, the php folks aren't certifying anything below version 4.3.0 with Apache 2.x as I understand it.

So - I'm waiting for php 4.3 and some indication that someone has successfully used php and Apache 2 without hacking phpBB before I give it a whirl.
AcidXero
Registered User
Posts: 9
Joined: Fri Nov 29, 2002 4:20 am
Location: lost & found
Contact:

Post by AcidXero »

Oh wow, thank you so much hexoplastia :D

*whew*
Antoha
Registered User
Posts: 1
Joined: Tue Dec 03, 2002 6:08 am

Post by Antoha »

2hexoplastia Very thanks, I was ready to kill phpbb, but now it's will be live :)
boo
Registered User
Posts: 44
Joined: Sat Dec 07, 2002 3:27 pm

Question about cache fix

Post by boo »

This thread is old but I am hoping some one is still around to answer this question.

I did the fix that hexoplastia showed us, however in over all header I now have this:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Pragma" content="no-cache"> 
<meta http-equiv="cache-control" content="no-cache"> 
<meta http-equiv="Expires" content="-1">
{META}
Is this ok, or should I remove the first two meta's that were there already, meaning these two:

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
Also I was wondering what {META} means? is that supposed to be removed also?

I am also using fetchall, what do i enter in the head tags there? anything? any type of meta needed there in portal.php?
cosmos
Registered User
Posts: 55
Joined: Mon Jan 13, 2003 6:49 am

Re: Another solution

Post by cosmos »

hexoplastia wrote: I'm not running RH8, but RH7.1.
First, I've commented the three header() function calls that you can find in the phpbb file, located at <phpbb directory>/includes/page_header.php, near the end of the file, starting at the line number 449:

header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

Comment them, so they look as follows:
// header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
// header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
// header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

You can also just delete those three lines.
Those lines puts a header in the html connection wich is sent to the user, due to the fact that those headers are included as POST data, they have more priority than conventional META TAGS. (I think is for that reason, not sure)

They do have higher priority, because they are part of the HTTP draft standard. However, these are not POST-related data, but part of the actual HTTP response header itself. See RFC2616: HTTP/1.1 Specs (THE reference for whatever is related to the web).

The phpBB problem, which is also shared by other boards, is the fact that in the first place the existing code did allow caching to take place. IE complicates things a little bit, since it allows either a HTTP/1.1 or HTTP/1.0 behaviour for either direct connections or intermediate ones (i.e. through the use of a proxy). To cater for both protocol version browsers and proxies, one should take into account that certain HTTP response fields exist only in the 1.1 specification (Cache-Control and its directives, Age) while others in the 1.0 specs (Expires and Pragma). Therefore the three (out of four) fields (Cache-Control, Expires, Pragma) should be present in a response.

Of course the next logical question is how to set them. The answer is that they should reflect the freshness of material. For a gif that changes every Sunday, these directives should indicate that the material is fresh (HTTP/1.1 term) till Sunday blah, blah. For dynamically generated pages (i.e. PHP scripts of this BB) these directives should indicate that the information contained is valid for exactly the moment this information was generated.
Additionally, one must keep in mind for exactly how long should information

So, now we don't have any cache-control information with the pages that are sent to our phpbb users. To ensure that the pages will be always reloaded, and not taken from the cache, I've added the conventional META TAGS to my overall_header.tpl file, located in <phpbb directory>/templates/<theme name>/


<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="Expires" content="-1">

Remember that those <meta>s have to be inserted inside the <head> ... </head> tags.

Also, I've read somewhere that some versions of IE browsers have a bug in their cache control, and the solution is to put one <meta> in other <head> ... </head> section, located at the end of the HTML page.

To do this, I've inserted the following lines in the file overall_footer.tpl, located in the same place as the header:

<head>
<meta http-equiv="PRAGMA" content="NO-CACHE">
</head>

Remember to insert those three lines outside the <body> ... </body> tag, but inside the <html> ... </html> tag, si it looks as follows:

------------------
(... whatever HTML your overall_footer.tpl has ...)

</body>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE">
</head>
</html>
------------------

Please do not! Inserting META HTTP-EQUIVs inside a page will certainly not affect proxies that may live in the middle! Browsers may or may not honour them as well. In fact, the entire HTTP-EQUIV thing was suggested in the early days of HTML. The only correct and per-spec mechanism is to emit the Pragma, Expires, Cache-Control directives as part of the HTTP response.

Therefore my suggestion is to:
1. Modify the three header lines into:

Code: Select all

header ('Cache-Control: no-store'); 
header ('Expires: 0'); 
header ('Pragma: no-cache');  
Notice that HTTP response field Last-Modified will no longer be transmitted. Cache-Control is set to the extremely anti-caching value no-store (correct thing to do). Additionally note that the expires field is set to 0, which is a value all browsers proxies should pay special attention to. Check the link above if in doubt ;)

2. Remove all METAs for HTTP-EQUIV, that set values to one or more of the following HTTP response fieldsExpires, Cache-Control, Pragma.

That should take care of things not as a quick fix, but rather as a "the correct thing to do" approach. Therefore, if a fix is found to make Apache+PHP work together in piece, behaviour per steps 1-2 above should still be followed.

And if bb admins are afraid of the additional load, then they actually increase perceived site throughput with a couple of tricks!! But that, as they say, is another story ;)

PS: If someone has problems following my suggestions, then please PM me posting also a link to his/her problematic forum. I'd be happy to have a look.
boo
Registered User
Posts: 44
Joined: Sat Dec 07, 2002 3:27 pm

Oh my......

Post by boo »

Oh my, I have no clue what you all are talking about, couldn't someone help us newbies by making a mod that spells this out..? Where to put what and exactly what to put. I have no clue what any of this means even if you write a book on it, it makes no sense to me.

I just want members to be able to login. I get aol people saying they can't login and I have no clue what to tell them. Now that I have added what hexoplastia said to add, I don't even know if that is right...

Can anyone finally set this all straight for those of us that are not programers and wouldn't have to the time to become programers?

I love this phpbb board but it would seem usless if folks couldn't use it because of proxies and this other stuff you are all talking about....

I am not ungrateful, just not smart enough to understand what your talking about. But I can follow exact instructions, so if you know what is already in the 2.0.3 version than you could tell us specifically what to remove and replace with. NO?

Forgive me for asking, if this is just not possible, but I just can't follow you all..... :cry:

Cherie
cosmos
Registered User
Posts: 55
Joined: Mon Jan 13, 2003 6:49 am

Re: Oh my......

Post by cosmos »

boo wrote: Can anyone finally set this all straight for those of us that are not programers and wouldn't have to the time to become programers?


Try this: change the three header() function calls that you can find in the phpbb file, located at <phpbb directory>/includes/page_header.php, near the end of the file, starting at the line number 449:

Code: Select all

header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); 
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); 
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 
... into the following:

Code: Select all

header ('Cache-Control: no-store'); 
header ('Expires: 0'); 
header ('Pragma: no-cache');
attriel
Registered User
Posts: 5
Joined: Mon Nov 19, 2001 11:27 pm
Contact:

Post by attriel »

allan wrote: php 4.3.0RC1 was just released. Although some people say that Apache 2.0.42 fixes the problem we're talking about, the php folks aren't certifying anything below version 4.3.0 with Apache 2.x as I understand it.

So - I'm waiting for php 4.3 and some indication that someone has successfully used php and Apache 2 without hacking phpBB before I give it a whirl.


Well, I have apache2.0.43 and php4.3.0 release, and I get the same caching issues :/

back in august when I encountered this with another setup (2.0.39 and 4.2.2), php folks on IRC told me (a) it was a "known problem with apache being stupid" or (b) apache2 is unsupported, shove off :/

The apache folks I talked to last summer (including the guy writing the php module) said they'd never heard of the problem and they'd look into it :/ I had hoped it was fixed in 4.3.0/2.0.43, but apparently not :/

I'm looking into figuring outthe scope (how many other php apps don't work, since <? print time(); ?> works fine, i'm wondering if they can't fix it b/c it's not their problem :o)

The hard part being that the people I was setting up boards for want their boards working , not me playing and tinkering :o Hopefully my dev server will start WORKING soon so I can play with this properly ...

Thanks for the workaround, though! Hopefully this can be eliminated by fixing (a) Apache 2, (b) PHP 4, or (c) PHPBB, whichever has a "problem" that can be "solved" :/

--attriel
boo
Registered User
Posts: 44
Joined: Sat Dec 07, 2002 3:27 pm

Anything else?

Post by boo »

I changed that as you said Cosmos, in page_header file, but what do I do with this in overall_header.tpl?

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Pragma" content="no-cache"> 
<meta http-equiv="cache-control" content="no-cache"> 
<meta http-equiv="Expires" content="-1">
{META}
do I remove this or what?


And in over_footer.tpl I have this:

Code: Select all

<meta meta http-equiv="PRAGMA" content="NO-CACHE"> 
do I also remove this? or change it to something else you have not mentioned yet?
Talisman1313
Registered User
Posts: 3
Joined: Tue Jan 14, 2003 5:24 am

private messages very slow

Post by Talisman1313 »

I am using Redhat 8.0/Apache2/php4. I used the meta tag fix for the caching problem, worked fine. I am having a problem with Private Messages, when you hit submit, you get the busy logo for a long time(better than 3 minutes), it sends the message, but this cannot be normal.

Any ideas?

Thanks.
cosmos
Registered User
Posts: 55
Joined: Mon Jan 13, 2003 6:49 am

Re: Anything else?

Post by cosmos »

boo wrote: I changed that as you said Cosmos, in page_header file, but what do I do with this in overall_header.tpl?

Code: Select all

&meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}"&
&meta http-equiv="Content-Style-Type" content="text/css"&
&meta http-equiv="Pragma" content="no-cache"& 
&meta http-equiv="cache-control" content="no-cache"& 
&meta http-equiv="Expires" content="-1"&
{META}
do I remove this or what?


And in over_footer.tpl I have this:

Code: Select all

&meta meta http-equiv="PRAGMA" content="NO-CACHE"& 
do I also remove this? or change it to something else you have not mentioned yet?


In a previous post in this thread...
cosmos wrote: 2. Remove all METAs for HTTP-EQUIV, that set values to one or more of the following HTTP response fields Expires, Cache-Control, Pragma.

Therefore, omit somes lines to have your code read:

Code: Select all

&meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}"& 
&meta http-equiv="Content-Style-Type" content="text/css"& 
{META} 
Additionally, remove the line you've mentioned in over_footer.ps entirely. That's it! Just write a word here if your board works now without caching problems! :)

PS: This is somewhat off-topic, but I could write a line or two on how you could improve perceived site responsiveness by setting freshness values for your site's static material (GIFs for example). This will certainly boost performance, since although these images are small, there is a high cost associated with HTTP "call setup" for each image. I can see that www.phpbb.com has implemented a good strategy for this issue. Anyway, are you interested? If so, just let me know, although I am not aware if such a guide is available in this forum somewhere...
Locked

Return to “2.0.x Discussion”