|
|
| Author |
Message |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Thu Nov 27, 2003 3:37 am Post subject: Warning: Cannot add header information...in forums |
|
|
|
Problem: You get errors of the form:
| Code: |
Warning: Cannot modify header information – headers already sent
|
when vieweing the forums.
Solution 1: Near the start of mainfile.php find:
| Code: |
42 = phpversion();
if (42 >= '4.0.4pl1' && strstr(Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1),'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
} else if (42 > '4.0') {
|
and change it to:
| Code: |
42 = phpversion();
if (42 >= '4.0.4pl1')
{
ob_start('ob_gzhandler');
}else if (42 > '4.0') {
|
Solution 2: Add the following line to a .htaccess file placed in your root PHP-Nuke directory:
| Code: |
PHP_FLAG output_buffering on
|
or if you have access to your php.ini, set:
| Code: |
output_buffering=on;
|
See Warning: Cannot modify header information on Forums and Cannot modify header information. _________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
arcon Private

Joined: 19 Sep 2004 Posts: 1
|
Posted: Sun Sep 19, 2004 1:46 pm Post subject: |
|
|
|
On my system the solution posted here did not work.
After messing around i found that this one worked.
(on php-nuke 7.1)
Enjoy
Arconious
Paste this into the mainfile instead of the one above if the one above does not work.
| Code: | $phpversion;
if (42 >= '4.0.4pl1')
{
ob_start('ob_gzhandler');
}else if (42 > '4.0') { |
|
|
| Back to top |
|
 |
dhyde79 Private

Joined: 23 Oct 2004 Posts: 1
|
Posted: Sat Oct 23, 2004 5:34 am Post subject: a problem |
|
|
|
on my system, with phpnuke7.4, neither of these solutions work, and there is no .htaccess file in the main directory to modify...
the closest line to the above one that is to be searched for, is as follows...
| Code: |
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
|
please, if you could, tell me what I must do to fix this, I tried removing from the && to the first ) and the "if (extension_loaded('zlib')) { ob_end_clean();" and then I get an error that's a total fail to load the page at all because of a miscompile or something to that effect. |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Tue Oct 26, 2004 6:48 pm Post subject: Re: a problem |
|
|
|
| dhyde79 wrote: | on my system, with phpnuke7.4, neither of these solutions work, and there is no .htaccess file in the main directory to modify...
 |
Fine. You can create one.
A .htaccess file is not part of PHP-Nuke.
| Quote: | the closest line to the above one that is to be searched for, is as follows...
| Code: |
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
|
 |
OR try:
| Code: |
$phpver = phpversion();
if ($phpver >= '4.0.4pl1') {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
|
_________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
checksum Private

Joined: 24 Dec 2004 Posts: 1
|
Posted: Fri Dec 24, 2004 11:53 pm Post subject: |
|
|
|
The funny thing is I only see the error with Firefox 1.0 when I am logged in.
But solution #2 fixed it for firefox. |
|
| Back to top |
|
 |
Wingman Private

Joined: 25 Oct 2005 Posts: 2
|
Posted: Tue Oct 25, 2005 10:55 pm Post subject: |
|
|
|
My code was -->
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
Aswell so i changed it to --->
$phpver = phpversion();
if ($phpver >= '4.0.4pl1') {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
And still comes up.. any other idears? I am useing phpnuke 7.5
Cheers.
My phpnuke forum : http://www.frenzey.777mb.com/modules.php?name=Forums |
|
| Back to top |
|
 |
Jake-138 Private

Joined: 11 Jul 2004 Posts: 4
|
Posted: Sun Jan 07, 2007 10:55 pm Post subject: |
|
|
|
| Wingman wrote: | My code was -->
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
Aswell so i changed it to --->
$phpver = phpversion();
if ($phpver >= '4.0.4pl1') {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
And still comes up.. any other idears? I am useing phpnuke 7.5
Cheers.
My phpnuke forum : http://www.frenzey.777mb.com/modules.php?name=Forums |
I am using PHPNuke 7.5 and this worked for me. Thanks!  _________________ Jake #138 |
|
| Back to top |
|
 |
|
|
 |
|
|