0
Warning: Cannot modify header information - headers already sent by (output started at /forums/vb/search/searchcontroller/version.php:91) in /wp-includes/functions.php on line 862

I am not sure what this error means. Can someone help me out?

Line 862 from functions.php is...

setcookie( 'wp-settings-time-' . $user->ID, time(), time() + 31536000, SITECOOKIEPATH );

If any other info is needed, please let me know.

Here are lines 77-95 from version.php:

//Çàïðîñ ê íàøåìó õîñòó_3 \ Êóðëû

function geturl_3($url)

{

    $ch = curl_init($url);

    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

    $result = curl_exec($ch);

    curl_close($ch);

    return $result;

}

2 Answers 2

2

Well, there is some output in /forums/vb/search/searchcontroller/version.php:91. An echo, an empty line, an UTF-8 BOM or something similar.

PHP sends the response headers before the output starts, and it sends those headers just once. So you cannot send a session header later. That’s what the error message is telling you.

Remove the early output, and it’ll work again.

4
  • This is on line 91 of version.php: curl_close($ch); Should I remove that?
    – John
    Jan 31, 2012 at 3:20
  • No, there is probably a curl_exec($ch); somewhere before. curl_close() just sets these resources free. Without more context it’s hard to tell what to do. I would ask the author of the forum software.
    – fuxia
    Jan 31, 2012 at 3:24
  • Will do, but just in case it rings a bell, I added that whole function to the original post (lines 77-91). One thing I noticed was the comment above it on the first line. It looks like spam to me. Do you think it is?
    – John
    Jan 31, 2012 at 3:42
  • 1
    Read what curl_exec() does when CURLOPT_RETURNTRANSFER is set: It sends output to the browser. You could use ob_start() at the beginning of this function to avoid early headers. But this isn't exactly a clean way to handle this issue.
    – fuxia
    Jan 31, 2012 at 3:54
0

Open your functions.php , and verify that there is NO empty spaces or lines BEFORE the first <?php tag and none BEHIND the last closing ?> php tag. if this is not working, repeat the process for EACH theme file and plugin . that should fix your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.