Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I made a custom theme and it's working fine on my WAMP development server but when put on the LAMP staging environment I get this error from inside my functions.php file:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent 

I've checked around and tried to remove the BOM from the beginning of the file but that didn't have any effect.

The code error message indicates that the problem is in this chunk of code:

<?php
function custom_excerpt_length( $length ) {
  return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
?>

Any suggestions welcome.

share|improve this question
Isn't there a "headers already started at" part to that message? That part points to the filter code? Do you have WP_DEBUG set to true? – s_ha_dum Dec 6 '12 at 15:26
Yes there's a "headers already started at" part to that message. WP_DEBUG is set to false. I have actually solved the problem by recreating the functions.php file. Probably it was really some sort of encoding problem. – L. De Leo Dec 6 '12 at 15:34

closed as too localized by toscho Jan 6 at 5:25

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.