Topic on Project:Support desk

Warning: Cannot modify header information

4
AnonymusGdpr (talkcontribs)

Referring to this Manual page: Manual:Errors_and_symptoms#Warning:_Cannot_modify_header_information_-_headers_already_sent_by_.28....29

Since upgrading to Mediawiki 1.27.1, I get literally thousands of error messages in the apache logfile, telling "[:error] [pid ...] [client ...] PHP Warning:  Cannot modify header information - headers already sent in /var/www/mediawiki/includes/WebResponse.php on line 42, referer: " & URL of wikipage. I found the above mentioned manual page but I cannot identify the problem. There are no additional characters in LocalSettings.php nor WebResponse.php, the latter of course has not been modified by anyone. So, where can I find the exact file that causes the problem?

  • Ubuntu 14.04.5
  • Apache 2.4.7
  • PHP 5.5.9
  • MySQL 5.5.54
  • MediaWiki 1.27.1
AhmadF.Cheema (talkcontribs)

Maybe try copying the LocalSettings.php entire text and save it into a new file (as was done in this very old Topic:Q9h4dou4khfuho11).

AnonymusGdpr (talkcontribs)

Done, no difference. Thank you anyway. The source of the evil seems to be a spambot that attacks our wiki since a few days. As soon as I excluded the IP, there have been no more of the above error messages.

On the other hand I can hardly believe that a bot may cause such sort of errors. Either the wiki does send a wrong header for whatever reason, then the error should be corrected. Or the headers are correct, then there should be no error message at all.

Ciencia Al Poder (talkcontribs)

Indeed. If browsing the wiki normally doesn't give this sort of errors, you may look at the access or error logs for the exact URL the spammer is hitting.

The header error is usually caused by PHP errors or warnings being sent to the client, before sending headers