0

I have a blog at: http://www.techonomic.com/

I created my own theme, and after porting to a new host, I get the following messages while trying to log in:

Warning: Cannot modify header information - headers already sent by (output started at /customers/c/5/c/techonomic.com/httpd.www/wp-content/themes/techonomic/functions.php:59) in /customers/c/5/c/techonomic.com/httpd.www/wp-includes/functions.php on line 861

Warning: Cannot modify header information - headers already sent by (output started at /customers/c/5/c/techonomic.com/httpd.www/wp-content/themes/techonomic/functions.php:59) in /customers/c/5/c/techonomic.com/httpd.www/wp-includes/functions.php on line 862

The trouble is, its hard to tell whats on those lines because funtions.php is only about 100 lines long, but obviously the code is making it longer when executed.

thanks for your help

Community
  • 1
  • 1
Wayneio
  • 3,466
  • 7
  • 42
  • 73
  • 2
    this has been asked and answered around 10 billion times, search first please. –  May 08 '12 at 21:13
  • Thanks, but I have done a search, but most of the issues I found are either specific to their code or I can't understand what they mean, and dont want to jump on an old thread to ask. – Wayneio May 08 '12 at 21:18
  • no output before headers, end of story. –  May 08 '12 at 21:19

2 Answers2

1

Turn on output buffering. You probably have it disabled on your new server

Paul Dessert
  • 6,363
  • 8
  • 47
  • 74
  • I found a page online that said to use "php_value output_buffering 1" in htaccess, so i did and it appears to have not made any difference? – Wayneio May 08 '12 at 21:22
  • 1
    output buffering, is a hack, fix it properly. –  May 08 '12 at 21:31
  • 1
    Read this. http://stackoverflow.com/questions/4620977/php-output-buffering But I do agree with @Dagon If at all possible, fix it properly before messing with output buffering – Paul Dessert May 08 '12 at 21:35
  • yes i was being simple, there is a place for output buffering, have used it, will use it, but 99.99% of the time for the headers already sent error, this is not the best solution. –  May 08 '12 at 21:37
1

Open up the file /customers/c/5/c/techonomic.com/httpd.www/wp-content/themes/techonomic/functions.php, go to line 59, and figure out what is outputting data before the headers are sent. It could be an error message for a failing function call, or any number of other things outputting data prematurely.

Bottom line: You cannot output any data to the browser before trying to change the HTTP headers.

nickb
  • 59,313
  • 13
  • 108
  • 143