I'm having a bit of trouble with a 'headers already sent' error from a Wordpress plugin I had built for me and now I'm adapting. This is the error:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home1/uname/directory/domain.com/wp-content/themes/ibm/header.php:2) in /home1/uname/directory/domain.com/wp-content/plugins/osu-rfm/osu-rfm.php on line 225
I've looked at header.php line 2 and this is what is there with no extra white spaces nor funny characters etc:
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7 ]> <html class="ie ie7 no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8 ]> <html class="ie ie8 no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 9 ]> <html class="ie ie9 no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" <?php language_attributes(); ?>><!--<![endif]-->
<!-- the "no-js" class is for Modernizr. -->
<head id="osu-rfm" data-template-set="html5-reset-wordpress-theme" profile="http://gmpg.org/xfn/11">
<title>
<?php
if (function_exists('is_tag') && is_tag()) {
single_tag_title("Tag Archive for ""); echo '" - '; }
I've looked at line 225 in osu-rfm.php and this is what is part of that file (this is the plugin btw):
public static function enable_sessions()
{
if( is_post_type_archive( "ibmdirectory" ) || "ibmdirectory" == get_post_type() )
{
if( ! isset( $_SESSION ) )
/*
if(headers_sent($filename, $linenum)) {
//if headers already sent out print some message.
echo "Headers already sent in $filename on line $linenum\n";
} else {
//if headers not already sent
echo "New headers";
}
*/
session_start();
}
}
And now I'm completely stuck as I don't know what to try next...can anyone make some suggestions? I removed all white space at the end and beginning in all my theme files as suggested here, but it doesn't seem to make a difference. I've also tried removing the closing ?>
tag at the end of my plugin file, but nada.
By the way, this only happens on my live server, not my local set up, so I have the feeling it could be a server issue.
Thanks
Osu
header.php
wp-config.php
:define('WP_DEBUG', false);
- I assume you meant that rather than php.ini?