0

Possible Duplicate:
“Warning: Headers already sent” in PHP

So I am having a strange error, and I have stuff in place to defeat that purpose. Upon a successful update of the WordPress theme you should be instantly redirected to a specific location. Well before that use to freak out and say:

Warning: Cannot modify header information - headers already sent by (output started at /home/kyle/WordPress/WordPressDev/wp-includes/script-loader.php:789) in /home/kyle/WordPress/WordPressDev/wp-includes/pluggable.php on line 881

So some one came along and said, hey put this in your functions.php and it will work:

 function callback($buffer){
     return $buffer;
 }

 function add_ob_start(){
     ob_start("callback");
 }

 function flush_ob_end(){
     ob_end_flush();
 }

 add_action('wp_head', 'add_ob_start');
 add_action('wp_footer', 'flush_ob_end');

Essentially this should make sure that things like redirections are done before anything else is done.

Well, I am getting the header issue on code such as:

$aisis_unzip_to = ABSPATH . $wp_filesystem->wp_content_dir() . "wp-content/themes/" . get_option('template') . "/";

$this->delete_contents_check();

$aisis_do_unzip = unzip_file($aisis_temp_file_download, $aisis_unzip_to);
unlink($aisis_temp_file_download); 

//Error Checking here - if we pass do the following:

wp_redirect(admin_url('admin.php?page=aisis-core-options'));

Any ideas as to why this error is being thrown and HOW to solve it please?

Community
  • 1
  • 1
TheWebs
  • 12,470
  • 30
  • 107
  • 211
  • Check your PHP log for errors in these unzip & file manipulation processes. If you're throwing errors, it may be blowing up the entire page. – N Rohler Nov 09 '12 at 23:07

1 Answers1

1

Usually it is end-of-line or something after closing tag ?> in .php file, try to remove ?> php works fine without it and you don't have this problem.

Zdenek Machek
  • 1,758
  • 1
  • 20
  • 30