Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Tue Jun 06, 2006 12:04 pm Reply with quote

Cannot modify header information - headers already sent by error again. I have not had it for a while now. Why would it be coming back? Thanks!
 
View user's profile Send private message Visit poster's website
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Tue Jun 06, 2006 12:09 pm Reply with quote

I had the same problem recently. I made some changes on my mainfile and finally resolved it. The posts I used to guide me were on this site and one other. I'll try to find the info and post it for you, but you can search here and find some answers or at least compare the beginning of your mainfile to what's posted.

One thing I do remember changing was adding a command to .htaccess. if you're a RWH client like me, you can try adding this to your .htaccess:
Quote:
PHP_FLAG output_buffering on

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
blith







PostPosted: Tue Jun 06, 2006 12:35 pm Reply with quote

kguske wrote:
I had the same problem recently. I made some changes on my mainfile and finally resolved it. The posts I used to guide me were on this site and one other. I'll try to find the info and post it for you, but you can search here and find some answers or at least compare the beginning of your mainfile to what's posted.

One thing I do remember changing was adding a command to .htaccess. if you're a RWH client like me, you can try adding this to your .htaccess:
Quote:
PHP_FLAG output_buffering on

I am a RWH client. I have that line in my .htaccess but I thought recently Raven sent us emails pertaining to a change with this. I am looking abck over them but I cannot figure out what i should do.
 
kguske







PostPosted: Tue Jun 06, 2006 12:52 pm Reply with quote

Then you may need changes in your mainfile. Mine looks like this:
Code:
$phpver = phpversion();

if ($phpver < '4.1.0') {
    $_GET = $HTTP_GET_VARS;
    $_POST = $HTTP_POST_VARS;
    $_SERVER = $HTTP_SERVER_VARS;
}
if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) {
    if (extension_loaded('zlib')) {
#   ob_end_clean();
   ob_start('ob_gzhandler');
    }
} else if ($phpver > '4.0') {
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
   if (extension_loaded('zlib')) {
       $do_gzip_compress = TRUE;
       ob_start(array('ob_gzhandler',5));
       ob_implicit_flush(0);
       header('Content-Encoding: gzip');
   }
    }
}

$phpver = explode(".", $phpver);
$phpver = "$phpver[0]$phpver[1]";
if ($phpver >= 41) {
    $PHP_SELF = $_SERVER['PHP_SELF'];
}

if (defined('FORUM_ADMIN')) {
    @include_once("../../../includes/nukesentinel.php");
} elseif (defined('INSIDE_MOD')) {
    @include_once("../../includes/nukesentinel.php");
} else {
    @include_once("includes/nukesentinel.php");
}

if (!ini_get("register_globals")) {
    import_request_variables('GPC');
}

if(isset($admin))
{
   $admin = base64_decode($admin);
   $admin = addslashes($admin);
   $admin = base64_encode($admin);
}

if(isset($user))
{
   $user = base64_decode($user);
   $user = addslashes($user);
   $user = base64_encode($user);
}
 
blith







PostPosted: Tue Jun 06, 2006 1:17 pm Reply with quote

kguske wrote:
Then you may need changes in your mainfile. Mine looks like this:
Code:
$phpver = phpversion();

if ($phpver < '4.1.0') {
    $_GET = $HTTP_GET_VARS;
    $_POST = $HTTP_POST_VARS;
    $_SERVER = $HTTP_SERVER_VARS;
}
if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) {
    if (extension_loaded('zlib')) {
#   ob_end_clean();
   ob_start('ob_gzhandler');
    }
} else if ($phpver > '4.0') {
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
   if (extension_loaded('zlib')) {
       $do_gzip_compress = TRUE;
       ob_start(array('ob_gzhandler',5));
       ob_implicit_flush(0);
       header('Content-Encoding: gzip');
   }
    }
}

$phpver = explode(".", $phpver);
$phpver = "$phpver[0]$phpver[1]";
if ($phpver >= 41) {
    $PHP_SELF = $_SERVER['PHP_SELF'];
}

if (defined('FORUM_ADMIN')) {
    @include_once("../../../includes/nukesentinel.php");
} elseif (defined('INSIDE_MOD')) {
    @include_once("../../includes/nukesentinel.php");
} else {
    @include_once("includes/nukesentinel.php");
}

if (!ini_get("register_globals")) {
    import_request_variables('GPC');
}

if(isset($admin))
{
   $admin = base64_decode($admin);
   $admin = addslashes($admin);
   $admin = base64_encode($admin);
}

if(isset($user))
{
   $user = base64_decode($user);
   $user = addslashes($user);
   $user = base64_encode($user);
}

Thank you for this but what is this based on? Where did you learn of these changes. I have different things in my mainfile. I am running Sentinel 2.02 with Sentinel 2.4.2pl8
 
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Tue Jun 06, 2006 1:18 pm Reply with quote

Depending on changes made ... ever heard of suexec?

I just upgraded my server and guess what... no more php as cgi. What took me years to almost get my head around, now needs learning a different way. (nuke t' you drop, I guess. <g>)

When I lost the suexec my XP users (not win2k) experienced header notices in the PM module. Sessions.php and page-header.php were not playing nice.

If your .htaccess file can give directives (non suexec) then ending that output buffering, as above in kguske post, should get rid of excess header notices.

Also have a look at the if phpversion (); in mainfile.php. Depending on your nuke version there may need to be edits.

Also, when making any changes continue to check CPanel Statistics / Error Log making sure the changes are completing cleanly. That error log is my best nuking friend. Smile

RavensScripts
my second best friend

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
kguske







PostPosted: Tue Jun 06, 2006 1:32 pm Reply with quote

blith, that's based on the posts I found here at RavenPHPScripts and one I found elsewhere. It shouldn't matter which version of Sentinel you're using, though it might matter which patch version you're using. If I remember correctly, the .htaccess change did the trick, so I'm not sure why it isn't working for you...

CodyG, Raven switched to CGI (why would be an interesting story), which is when I suspect these issues began for blith and me.
 
blith







PostPosted: Tue Jun 06, 2006 1:55 pm Reply with quote

kguske wrote:
blith, that's based on the posts I found here at RavenPHPScripts and one I found elsewhere. It shouldn't matter which version of Sentinel you're using, though it might matter which patch version you're using. If I remember correctly, the .htaccess change did the trick, so I'm not sure why it isn't working for you...

CodyG, Raven switched to CGI (why would be an interesting story), which is when I suspect these issues began for blith and me.

Thanks! I keep doing that!! I meant RavenNuke 2.02... darn it.. So would that make any difference?
 
kguske







PostPosted: Tue Jun 06, 2006 2:01 pm Reply with quote

It shouldn't make any difference. I test RN on another server, and I'm running a modified version of 7.5 on my RWH site.
 
montego
Site Admin



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

PostPosted: Tue Jun 06, 2006 10:11 pm Reply with quote

It was my understanding that Raven turned register globals off at the PHP level, but still allowed us to override that. I do not believe he has switched over to running as CGI as he has mentioned "battling the pros and cons" for several months. There are very significant cons to doing this as well... namely, performance on heavy access sites.

NS would not work right with HTTPAuth with register globals off, so one had to switch to CGIAuth, not to be confused with running PHP as CGI rather than running within Apache.

HOwever, I was looking through the pl8 code changes and I wonder if Bob has actually made HTTPAuth work with register globals off... Would sure like to know because HTTPAuth is a bit easier to understand for folks than CGIAuth (in terms of setup) and having register globals off is a very good thing... Smile

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
technocrat
Life Cycles Becoming CPU Cycles



Joined: Jul 07, 2005
Posts: 511

PostPosted: Wed Jun 07, 2006 7:48 am Reply with quote

Many times this can be caused by a php file with space(s) or newline(s) after the ?>

Are you getting the error on a particular file, or page? Did you just edit something recently?

config.php & mainfile.php are the 2 usual suspects.

_________________
Nuke-Evolution
phpBB-Evolution / phpBB-Evolution Blog 
View user's profile Send private message
kguske







PostPosted: Wed Jun 07, 2006 9:28 am Reply with quote

It happened to several of us on the same server at the same time without changes to scripts, but there were changes to php.ini settings, we believe.
 
blith







PostPosted: Wed Jun 07, 2006 9:50 am Reply with quote

I switched to CGI Auth when Raven suggested it. I have globals Off in my statement in htaccess now... but I have just encountered another error in the log

Code:
client denied by server configuration: /home/********/public_html/modules.php

What could that be? I turned on CGI auth in the Forums/admin folder...
 
kguske







PostPosted: Wed Jun 07, 2006 9:55 am Reply with quote

Someone tried to access your site that is blocked in your .htaccess.
 
montego







PostPosted: Wed Jun 07, 2006 8:02 pm Reply with quote

kguske wrote:
It happened to several of us on the same server at the same time without changes to scripts, but there were changes to php.ini settings, we believe.


I agree, but more likely related to register globals which is the change that was made. My two sites running on the same server were not impacted by this change, however, so don't know what to tell you.
 
blith







PostPosted: Tue Jun 13, 2006 3:07 pm Reply with quote

A little update. In the error log I am getting a reference to line 72 in themes.php. Here is that line
Code:
print $r_file;
Does this have anything to do with it?
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Tue Jun 13, 2006 3:44 pm Reply with quote

We may need a few lines either side of that to make a determination but you might want to check what value that variable has or change it from print to an echo to see if that helps.
 
View user's profile Send private message Send e-mail
montego







PostPosted: Tue Jun 13, 2006 9:47 pm Reply with quote

blith wrote:
I switched to CGI Auth when Raven suggested it. I have globals Off in my statement in htaccess now... but I have just encountered another error in the log

Code:
client denied by server configuration: /home/********/public_html/modules.php

What could that be? I turned on CGI auth in the Forums/admin folder...


blith, is your theme.php error just mentioned related at all to the quoted post above? I am confused how one would be related to the other, so need to ask. Thanks.

If not related, is there any error message along with that line reference in your error log??? Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©