This question has already been answered:

{"result": "Success"} Warning: Cannot modify header information - headers sent by (output started at / home / host1475174/site.ru/htdocs/www/auth.php:65) .ru / htdocs / www / auth.php on line 67

After authorization gives the error. For 2 hours I have been looking for a solution to the problem, probably tried everything.

Lines 65 and 67 from auth.php

  curl_exec ($ myCurl);
 header ('Location:'. $ urlreturn); 

Reported as a duplicate by participants ReinRaus , etki , Dmitriy Simushev , Alexey Shimansky , Nicolas Chabanovsky 2 May '16 at 20:35 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • 7
    Sometimes it seems to me that if you enter "porn" in Google, then it will produce fewer matches there than in the text of this error. Have you ever tried to search? - etki
  • The very link to this topic cannot-modify-header-information.ru - Alexey Shimansky

1 answer 1

The point is that HTTP headers must precede the body of the HTTP document. Since PHP is an interpreted language, the instructions in it are executed line by line. After you output something using echo or print instructions (in this case {"result": "Success"}), it is considered that you started to form the body of the HTTP document and no more headers will be sent.

Having encountered an attempt to send an HTTP header

header('Location: ' . $urlreturn); 

The interpreter displays a warning to you.