News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How to fix these errors

Started by DarkAngel612, June 11, 2013, 09:23:05 PM

Previous topic - Next topic

DarkAngel612

[08-Jun-2013 18:01:26] PHP Notice:  Undefined index:  server in /home/xxxxx/xxxxx/xxxxx/Sources/Subs-Post.php on line 622
[08-Jun-2013 18:01:26] PHP Notice:  Undefined index:  utf8 in /home/xxxxx/xxxxx/xxxxx/Sources/Subs-Post.php on line 1350
[08-Jun-2013 18:01:26] PHP Notice:  Undefined index:  utf8 in /home/xxxxx/xxxxx/xxxxx/Sources/Subs-Post.php on line 1352
[08-Jun-2013 18:01:26] PHP Notice:  Undefined index:  server in /home/xxxxx/xxxxx/xxxxx/Sources/Subs-Post.php on line 1372
[08-Jun-2013 18:01:26] PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: invalid UTF-8 string at offset 8 in /home/xxxxx/xxxxx/xxxxx/Sources/Subs-Post.php on line 1372
[11-Jun-2013 05:38:20] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420) in /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php on line 351
[11-Jun-2013 05:38:20] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420) in /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php on line 352
[11-Jun-2013 05:38:20] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420) in /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php on line 353
[11-Jun-2013 05:38:20] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420) in /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php on line 356
[11-Jun-2013 05:38:20] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420) in /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php on line 357
[11-Jun-2013 05:38:20] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420) in /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php on line 358
[11-Jun-2013 05:38:22] PHP Warning:  Cannot modify header information - headers


SMF 2.0.4
Latest Tiny Portal


Been getting these error for about a week now
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Shambles

Have a quick look at your Sources/Subs-Post.php file and see if there's any text (spaces or blank lines) before the opening <?php line or after the closing ?> line.

DarkAngel612

Quote from: Shambles on June 12, 2013, 04:02:03 AM
Have a quick look at your Sources/Subs-Post.php file and see if there's any text (spaces or blank lines) before the opening <?php line or after the closing ?> line.

I did take a look but there are no blank lines before that nor after the ending one.

more ideas?
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Shambles

Can we have a copy of the file attached to your next post.

MrPhil

QuoteCannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420)
says that Errors.php already output something to the browser too early. Are you seeing any error-type messages on your page (probably at the top)? It may be easier to spot them if you look at the HTML Page Source in the browser (ctrl+U or something like that). Once whatever is causing Errors.php to output is fixed (it might be the 'server' and 'utf8' problems), the header errors will go away.

The preg_replace error says that you have some Latin-1 text (accented characters, etc.) from someplace being used where UTF-8 is expected. Did you convert from Latin-1 recently? Did any database fields stay at Latin-1? Do you have any language support files that are Latin-1 (they must be UTF-8 versions if you are displaying your pages in UTF-8).

DarkAngel612

Quote from: Shambles on June 12, 2013, 06:31:04 AM
Can we have a copy of the file attached to your next post.

my next post?


Quote from: MrPhil on June 12, 2013, 10:57:10 AM
QuoteCannot modify header information - headers already sent by (output started at /home/xxxxx/xxxxx/xxxxx/Sources/Errors.php:420)
says that Errors.php already output something to the browser too early. Are you seeing any error-type messages on your page (probably at the top)? It may be easier to spot them if you look at the HTML Page Source in the browser (ctrl+U or something like that). Once whatever is causing Errors.php to output is fixed (it might be the 'server' and 'utf8' problems), the header errors will go away.

The preg_replace error says that you have some Latin-1 text (accented characters, etc.) from someplace being used where UTF-8 is expected. Did you convert from Latin-1 recently? Did any database fields stay at Latin-1? Do you have any language support files that are Latin-1 (they must be UTF-8 versions if you are displaying your pages in UTF-8).

It has been utf-8 from the installation and alll through the updates, even after I redid the installation fresh to get rid of some problems about a year ago.

Should I go into admin > maintenance >Convert HTML-entities to UTF-8 characters and use that section have it try to repair?

In case you have not figured it out, this is my problem forum, the others on this same server do not misbehave --- this one on the other hand is possessed. LOL

today I get this error in the error_log file found in the forums folder on ftp:

[12-Jun-2013 04:23:25] PHP Parse error:  syntax error, unexpected $end, expecting ']' in /home/xxxxxx/public_html/attic/Sources/Subs.php on line 3208


the code is here-- line is red is the one it states:

function determineTopicClass(&$topic_context)
{
    // Set topic class depending on locked status and number of replies.
    if ($topic_context['is_very_hot'])
        $topic_context['class'] = 'veryhot';
    elseif ($topic_context['is_hot'])
        $topic_context['class'] = 'hot';
    else
        $topic_context['class'] = 'normal';

    $topic_context['class'] .= $topic_context['is_poll'] ? '_poll' : '_post';

    if ($topic_context['is_locked'])
        $topic_context['class'] .= '_locked';

    if ($topic_context['is_sticky'])
        $topic_context['class'] .= '_sticky';

    // This is so old themes will still work.
    $topic_context['extended_class'] = &$topic_context['class'];
}


as for the stuff loading first in html, this is the part in the very beginning: If I understood you right.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="http://thefantasiesattic.net/attic/Themes/Insidious-2UD022013/css/index.css?fin20" />
    <script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<script type="text/javascript" src="http://thefantasiesattic.net/attic/Themes/default/scripts/script.js?fin20"></script>
<script type="text/javascript" src="http://thefantasiesattic.net/attic/Themes/Insidious-2UD022013/scripts/theme.js?fin20"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "http://thefantasiesattic.net/attic/Themes/Insidious-2UD022013";
var smf_default_theme_url = "http://thefantasiesattic.net/attic/Themes/default";
var smf_images_url = "http://thefantasiesattic.net/attic/Themes/Insidious-2UD022013/images";
var smf_scripturl = "http://thefantasiesattic.net/attic/index.php";
var smf_iso_case_folding = false;
var smf_charset = "UTF-8";
var ajax_notification_text = "Loading...";
var ajax_notification_cancel_text = "Cancel";
// ]]></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Fantasy Attic - Index" />
<meta name="keywords" content="3d art, contests,photshop, daz studio, poser,psp,vidoes,fun,fantasy,free stuff" />
<title>Fantasy Attic - Index</title>
<meta name="robots" content="noindex" />
<link rel="canonical" href="http://thefantasiesattic.net/attic/index.php" />
<link rel="help" href="http://thefantasiesattic.net/attic/index.php?action=help" />
<link rel="search" href="http://thefantasiesattic.net/attic/index.php?action=search" />
<link rel="contents" href="http://thefantasiesattic.net/attic/index.php" />
<link rel="alternate" type="application/rss+xml" title="Fantasy Attic - RSS" href="http://thefantasiesattic.net/attic/index.php?type=rss;action=.xml" />
<script type="text/javascript" src="http://thefantasiesattic.net/attic/Themes/default/highslide/highslide-full.packed.js"></script>
<script type="text/javascript" src="http://thefantasiesattic.net/attic/Themes/default/highslide/highslide.english.js"></script>
<link rel="stylesheet" type="text/css" href="http://thefantasiesattic.net/attic/Themes/default/highslide/highslide.css" media="screen" />
<script type="text/javascript">
hs.graphicsDir = "http://thefantasiesattic.net/attic/Themes/default/highslide/graphics/";
hs.outlineType = "rounded-white";
hs.align = "center";
hs.blockRightClick = "true";
</script>
      <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_header_smiley = false
                function expandHeaderSmiley(mode)
                {
                        smf_setThemeOption("expand_header_smiley", mode ? 1 : 0, null, "0b7511677ea4b7eb7b039e52f31976a6");
                        document.getElementById("expand_smiley").src = mode ? "http://thefantasiesattic.net/attic/Themes/default/images/tinyportal/TPcollapse.gif" : "http://thefantasiesattic.net/attic/Themes/default/images/tinyportal/TPexpand.gif";

                        document.getElementById("expandHeaderSmiley").style.display = mode ? "" : "none";

                        current_header_smiley = mode;
                }
        // ]]></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_header_bbc = true
                function expandHeaderBBC(mode)
                {
                        smf_setThemeOption("expand_header_bbc", mode ? 1 : 0, null, "0b7511677ea4b7eb7b039e52f31976a6");
                        document.getElementById("expand_bbc").src = mode ? "http://thefantasiesattic.net/attic/Themes/default/images/tinyportal/TPcollapse.gif" : "http://thefantasiesattic.net/attic/Themes/default/images/tinyportal/TPexpand.gif";

                        document.getElementById("expandHeaderBBC").style.display = mode ? "" : "none";

                        current_header_bbc = mode;
                }
        // ]]></script><link rel="stylesheet" type="text/css" href="http://thefantasiesattic.net/attic/Themes/Insidious-2UD022013/TPShout.css?fin20" />
<link rel="stylesheet" type="text/css" href="http://thefantasiesattic.net/attic/Themes/Insidious-2UD022013/tp-style.css?fin11" />
<style type="text/css">
.block_leftcontainer,
.block_rightcontainer,
.block_centercontainer,
.block_uppercontainer,
.block_lowercontainer,
.block_topcontainer,
.block_bottomcontainer
{
padding-bottom: 4px;
}
#tpleftbarHeader
{
margin-right: 4px;
}
#tprightbarHeader
{
margin-left: 4px;
}
</style>
  <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

var tpPanels = new Array();
function togglepanel( targetID )
{
var pstate = 0;
var panel = targetID;
var img = "toggle_" + targetID;
var ap = 0;

if ( document.getElementById ) {
target = document.getElementById( panel );
if ( target.style.display == "none" ) {
target.style.display = "";
pstate = 1;
removeFromArray(targetID, tpPanels);
document.cookie="tp_panels=" + tpPanels.join(",") + "; expires=Wednesday, 01-Aug-2040 08:00:00 GMT";
document.getElementById(img).src = 'http://thefantasiesattic.net/attic/Themes/default/images/tinyportal/TPupshrink.gif';
}
else {
target.style.display = "none";
pstate = 0;
tpPanels.push(targetID);
document.cookie="tp_panels=" + tpPanels.join(",") + "; expires=Wednesday, 01-Aug-2040 08:00:00 GMT";
document.getElementById(img).src = 'http://thefantasiesattic.net/attic/Themes/default/images/tinyportal/TPupshrink2.gif';
}
}
}
function removeFromArray(value, array){
for(var x=0;x<array.length;x++){
if(array[x]==value){
array.splice(x, 1);
}
}
return array;
}
function inArray(value, array){
for(var x=0;x<array.length;x++){
if(array[x]==value){
return 1;
}
}
return 0;
}
// ]]></script>
</head>

Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

MrPhil

Maybe it's been UTF-8 since Day One, but the error is complaining that someone tried to slip it some invalid non-UTF-8 characters (most likely single byte Latin-1 or Smart Quotes characters). Any editing done lately?

There's nothing to be gained right now by converting HTML entities to UTF-8 native characters. Eventually you might want to do it, to reduce your database size slightly.

"unexpected $end" usually means the file got cut off in the middle by a filesystem error, OR you are missing a ), ], or } and the function is still open when it hits the physical end of file. I don't see anything terribly wrong in the code you posted, so perhaps that's not really line 3208?

Your HTML page source doesn't appear to be showing anything unexpected before the opening <!DOCTYPE>. Perhaps there are some invisible control characters, or maybe one or more UTF-8 Byte Order Marks? Try telling your browser to display in Latin-1 (View > Character Encoding or something like that) and look at the page source again. If there are BOMs they should now show up.

Shambles

Quote from: DarkAngel612 on June 12, 2013, 05:12:34 PM

Quote from: Shambles on June 12, 2013, 06:31:04 AM
Can we have a copy of the file attached to your next post.

my next post?

Yeah, I meant attach the file here, to your next post on SM.ORG, so we can have a ganders at it.

DarkAngel612

Shambles,  in my primary post I just copy pasted the lines here so I am confused about a different post you refer to? I have been living on cold meds for this summer flu so forgive me my brain dead state.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Shambles

Quote from: DarkAngel612
Shambles,  in my primary post I just copy pasted the lines here so I am confused about a different post you refer to?

Your primary post doesn't contain anything to do with the content of Subs-Post.php.

Attaching your file to a post here in the forum means we can have a deep look at it. Copying and pasting lines might miss something not visible on your screen.

But as this is obviously so difficult to explain I think I'll dip out.

DarkAngel612


There is no need to get upset or react this way.

If you had just said at the beginning that you wanted to see that file I would have attached it....I am not totally stupid---just partially with these mind numbing pills for the flu..

May you never need them.

Here is the file for you or anyone else to look at.








Quote from: Shambles on June 13, 2013, 07:11:40 AM
Quote from: DarkAngel612
Shambles,  in my primary post I just copy pasted the lines here so I am confused about a different post you refer to?

Your primary post doesn't contain anything to do with the content of Subs-Post.php.

Attaching your file to a post here in the forum means we can have a deep look at it. Copying and pasting lines might miss something not visible on your screen.

But as this is obviously so difficult to explain I think I'll dip out.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Chalky

Sorry this has been overlooked, are you still having these problems?  I'm afraid this is beyond my skill but it's been a month now so I can give you a bump  :)

DarkAngel612

thanks --- I had to  reupload all the SMF files totally, reinstall my mods and it went away for a day...lol

Then I was told to look for any added lines at the top under <? --- also look for space prior to that and added lines/spaces immediately after the end ?>

After having it suddenly appear on only one forum it just started happening on all forums after the host migrated us to a new server complete with new IP's

I think for now there is a stop to it, I did find added lines to some of the addon files. And some of the themes that had never needed a modifications.english file before also needed one now to get rid of undefined.... errors.

so for now it is taken care of


The "fix"

Check all files for added space/line before <? and ?> then delete them. Also for anything that should not be entered immediately after the beginning <?

I sure hope it stops now ---- this has also fixed the content error message I started getting as well as the unable to change headers. --- for now.






Quote from: ChalkCat on July 13, 2013, 08:14:32 AM
Sorry this has been overlooked, are you still having these problems?  I'm afraid this is beyond my skill but it's been a month now so I can give you a bump  :)
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Chalky

Thanks for your detailed reply, hopefully it will help others searching for a solution to the same problem.  I'm glad it appears to be resolved and sorry I couldn't be much use...

Fingers crossed that everything stays good, but if you need any help in the future please do ask  :)

DarkAngel612

I certainly will cause I love this software and Tiny Portal...biased much???

:-*
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Advertisement: