PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Thu Sep 22, 2005 1:31 pm Reply with quote Back to top

A user of my site report me that he see this error on top of the forum:

Quote:
Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/SITENAME/home/themes/THEMENAME/theme.php:122) in /web/htdocs/SITENAME/home/includes/sessions.php on line 239

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/SITENAME/home/themes/THEMENAME/theme.php:122) in /web/htdocs/SITENAME/home/includes/sessions.php on line 240

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/SITENAME/home/themes/THEMENAME/theme.php:122) in /web/htdocs/SITENAME/home/includes/page_header.php on line 484

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/SITENAME/home/themes/THEMENAME/theme.php:122) in /web/htdocs/SITENAME/home/includes/page_header.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/SITENAME/home/themes/THEMENAME/theme.php:122) in /web/htdocs/SITENAME/home/includes/page_header.php on line 491


I dont get this error but probably other user yes... someone have a solution ?
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Thu Sep 22, 2005 5:46 pm Reply with quote Back to top

can we try?
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

PostPosted: Thu Sep 22, 2005 5:50 pm Reply with quote Back to top

Could this be the solution to your problem?
Only registered users can see links on this board!
Get registered or login to the forums!


montego
View user's profile Send private message Visit poster's website
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Sat Sep 24, 2005 1:38 pm Reply with quote Back to top

montego wrote:
Could this be the solution to your problem?
Only registered users can see links on this board!
Get registered or login to the forums!


montego


If you have access to php.ini set:
output_buffering = On


--> No I cannot modify php.ini

else copy the following into a file:
PHP_FLAG output_buffering On
save it as .htaccess and upload to the same place mainfile.php is located.


--> I cannot insert .htacces on my hosting server

Or add the following line to mainfile.php right after the file credits:
ini_set("output_buffering","1");


--> tried but users report me that the error remain.


The strange is that not all users seeing that error...
The "full" error is:
Code:
Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/sessions.php on line 239

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/sessions.php on line 240

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/page_header.php on line 484

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/page_header.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/page_header.php on line 491
View user's profile Send private message
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Mon Sep 26, 2005 2:15 pm Reply with quote Back to top

Looking in the Error Log of my domain I have found this error:

Code:

[error] [client 62.123.79.XXX] request failed: error reading the headers, referer: http://www.magic-style.org/modules.php?name=Forums&file=viewtopic&t=28911
[Mon Sep 26 22:09:29 2005]
[error] [client 213.140.21.XXX] Premature end of script headers: modules.php, referer: http://www.magic-style.org/modules.php?name=Private_Messages


Could it be linked with the other error ?
View user's profile Send private message
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Mon Sep 26, 2005 3:54 pm Reply with quote Back to top

In the apache error log I get these ones too:

Code:

PHP Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/sessions.php on line 239
PHP Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/sessions.php on line 240
PHP Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/page_header.php on line 488
PHP Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/page_header.php on line 490
PHP Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.magic-style.org/home/themes/magicstyle_green/theme.php:122) in /web/htdocs/www.magic-style.org/home/includes/page_header.php on line 491


I cannot post here my themeheader() function in "theme.php" but I think it's a "normal" one;
the line 122 that make the error is the "print $r_file";
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Sep 26, 2005 3:57 pm Reply with quote Back to top

Have your host fix the php.ini file.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Tue Sep 27, 2005 9:23 am Reply with quote Back to top

Raven wrote:
Have your host fix the php.ini file.


I cannot make them changes it, the php.ini is in common with other hundreds of sites... any other solution ?

You can found the settings on
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Sep 27, 2005 9:28 am Reply with quote Back to top

I understand that. He is being ignorant if he does not have it activated. All good hosts should either have it activated or allow .htaccess modification.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Tue Sep 27, 2005 12:07 pm Reply with quote Back to top

If someone need them, these are more information.

The lines that make appear the problem in my error log are:
in ./includes/page_header.php
Code:
header ('Cache-Control: no-cache, pre-check=0, post-check=0');
header ('Expires: 0');
header ('Pragma: no-cache');

in ./includes/sessions.php
Code:
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);

in ./theme/MYTHEME/theme.php
Code:
$tmpl_file = "themes/magicstyle_green/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;


Quote:
All good hosts should either have it activated or allow .htaccess modification.

I know... but 50€/year for domain + illimitate space + illimitate bw (best effort) + 100MB of DB MySQL and a couples of emails it's a good price :p
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

PostPosted: Tue Sep 27, 2005 8:38 pm Reply with quote Back to top

Might be a good price for YOU, but what about your site visitors??? I am with Raven. There is NO REASON not to allow these things if managed properly.

montego
View user's profile Send private message Visit poster's website
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Wed Sep 28, 2005 6:30 am Reply with quote Back to top

montego wrote:
Might be a good price for YOU

// little OT
That is the main Smile
If the price wasn't good for me the site never exist and site users too :p
And a error that I can remove with $display_errors = false; in the config file is not a really big problem for that price Wink
// end OT
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 28, 2005 7:01 am Reply with quote Back to top

You are hiding the error, yes, but you are not fixing the problem. Output_Buffering FIXES the problem. By not having output_buffering on, your application will not function correctly, even if it seems to. It may in this case, but in a case where multiple headers have to be gathered while interspersed with other browser output, which is very common, even in nuke, it will fail. So, before posting here or anywhere else when you have output problems, consider that. You are definitely sacrificing NEEDED functionality.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Wed Sep 28, 2005 9:18 am Reply with quote Back to top

Raven wrote:
You are hiding the error, yes, but you are not fixing the problem. Output_Buffering FIXES the problem.


In fact I posted the error to find a solution, not to hide it Wink
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 28, 2005 10:03 am Reply with quote Back to top

I understand and you have been given the solution. I'm just letting you know that by hiding it and not fixing it, you will have other unexplained issues down the line. It's such a simple fix and there is zero security risk for your host to change the output_buffering setting.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Wed Sep 28, 2005 12:49 pm Reply with quote Back to top

Raven wrote:
I understand and you have been given the solution


No, I haven't found the solution I have found a mode to hide.
I'm continue to search one, if someone can found it (without use of php.ini and .htaccess) please post it...

Quote:
It's such a simple fix and there is zero security risk for your host to change the output_buffering setting.

I know... but I cannot make them change if they dont want :-p
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 28, 2005 1:02 pm Reply with quote Back to top

Quote:
No, I haven't found the solution I have found a mode to hide.

Shmk,

Let's make no mistake about this. You most certainly have found the solution. The php.ini and/or .htaccess methods are the solution; a legitimate one and one that written for that very purpose by the authors of PHP.

Now, what you are after is a work-around/solution to your hosting company's incompetance, ignorance, or whatever you want to call it. To do that, you will need to recode and review all phpnuke code that uses the header() function. You will then need to rewrite any logic that writes to the browser before the header() function does. Then, you will need to syncronize the different scripts with one another to avoid timing issues between scripts. That's what output_buffering remedies. output_buffering assembles ALL html code before sending it to the browser and then organizes the headers first.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Wed Sep 28, 2005 2:10 pm Reply with quote Back to top

So there isn't another solution (work-around or anything u wanna call) except php.ini or .htaccess ? :-S
Ok so I'll have to hide, thx anyway Smile
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 28, 2005 2:15 pm Reply with quote Back to top

Quote:
So there isn't another solution (work-around or anything u wanna call) except php.ini or .htaccess ? :-S


Yes, as I posted above, here is the coding solution.

You will need to recode and review all phpnuke code that uses the header() function. You will then need to rewrite any logic that writes to the browser before the header() function does. Then, you will need to syncronize the different scripts with one another to avoid timing issues between scripts. That's what output_buffering remedies. output_buffering assembles ALL html code before sending it to the browser and then organizes the headers first.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Wed Sep 28, 2005 2:38 pm Reply with quote Back to top

A curiosity:
I relooked my php.ini and I have found that output_buffering is set to 4096...
I thought was a boolean true/false setting... what 4096 means ? Confused
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 28, 2005 3:04 pm Reply with quote Back to top

That's what it should be! So we went through all this for nothing. Are you sure your host didn't just change it?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Wed Sep 28, 2005 3:41 pm Reply with quote Back to top

Raven wrote:
Are you sure your host didn't just change it?


Mmmh don't know... but the error remains Sad
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 28, 2005 3:49 pm Reply with quote Back to top

Can you PM to me a link to phpinfo() ?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
shmk
Worker
Worker


Joined: Dec 21, 2004
Posts: 116

PostPosted: Tue Oct 04, 2005 10:01 am Reply with quote Back to top

My theme.php is
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Oct 04, 2005 10:04 am Reply with quote Back to top

That link is dead. Why are you posting it anyway?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum