MyBB Community Forums

Full Version: Cannot modify header information
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Have just done an install of 1.6.3 which all seemed to go well until the very last step.

There was a set of 3 warning messages. E.G.: "Warning [2] Cannot modify header information - headers already sent by (output started at /home/ampmaker/public_html/infocentre/inc/class_core.php:165) - Line: 1622 - File: inc/functions.php PHP 5.3.6 (Linux)"

The 3 messages are all similar, and in fact, the same set of messages appear at the top of the forum home page, which you can see here: http://www.ampmaker.com/infocentre/

Any ideas where I should look?

--------------full text of error message--------------
Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/ampmaker/public_html/infocentre/inc/class_core.php on line 165
The following warnings occurred:
Warning [2] Cannot modify header information - headers already sent by (output started at /home/ampmaker/public_html/infocentre/inc/class_core.php:165) - Line: 1622 - File: inc/functions.php PHP 5.3.6 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/functions.php 1622 header
/inc/class_session.php 360 my_setcookie
/inc/class_session.php 98 session->load_guest
/global.php 55 session->init
/member.php 19 require_once
Warning [2] Cannot modify header information - headers already sent by (output started at /home/ampmaker/public_html/infocentre/inc/class_core.php:165) - Line: 1622 - File: inc/functions.php PHP 5.3.6 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/functions.php 1622 header
/inc/class_session.php 365 my_setcookie
/inc/class_session.php 98 session->load_guest
/global.php 55 session->init
/member.php 19 require_once
Warning [2] Cannot modify header information - headers already sent by (output started at /home/ampmaker/public_html/infocentre/inc/class_core.php:165) - Line: 1622 - File: inc/functions.php PHP 5.3.6 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/functions.php 1622 header
/inc/class_session.php 106 my_setcookie
/global.php 55 session->init
/member.php 19 require_once
Warning [2] Cannot modify header information - headers already sent by (output started at /home/ampmaker/public_html/infocentre/inc/class_core.php:165) - Line: 1622 - File: inc/functions.php PHP 5.3.6 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/functions.php 1622 header
/member.php 989 my_setcookie
Your host should disable magic_quotes, but as a temp fix, in ./inc/class_core.php, find:

if(get_magic_quotes_gpc())
{
	$this->magicquotes = 1;
	$this->strip_slashes_array($_POST);
	$this->strip_slashes_array($_GET);
	$this->strip_slashes_array($_COOKIE);
}
set_magic_quotes_runtime(0);

change it to:

if(@get_magic_quotes_gpc())
{
	$this->magicquotes = 1;
	$this->strip_slashes_array($_POST);
	$this->strip_slashes_array($_GET);
	$this->strip_slashes_array($_COOKIE);
}
@set_magic_quotes_runtime(0);
Perfect - thanks. Smile Have done so and it's normal now and I can log in and post test threads.

Will contact my host re advice on turning magic_quotes off. (Seems it's some 'helpful' tool that causes more problems than it solves!)
Magic Quotes was deprecated in PHP 5.3, presumably because it caused more problems than it solved.
Thank you for this - my forum suddenly started to show this error when I had changed nothing. Presumably my hosts Hostpapa did however.

I did the file change above and now all is fine, so thank you again Smile

Sam / Bifford
(2011-05-26, 07:50 PM)Bifford Wrote: [ -> ]my forum suddenly started to show this error when I had changed nothing. Presumably my hosts Hostpapa did however.

They would have upgraded from PHP 5.2 to 5.3 Smile