03.16.07

WordPress Error: “Cannot modify header information - headers already sent”

Posted in Bugs at 4:06 pm by Željko Filipin

There was important security update of Wordpress recently. In upgrade instructions it is suggested to delete old files on the server, and then upload new files, and I did as they suggested.

A few days ago I wanted to upload an image and got this error message.

The uploaded file could not be moved to [...]/wp-content/uploads/[...].
Warning: Cannot modify header information - headers already sent by (output started at [...]/wp-admin/admin-functions.php:1879) in [...]/wp-includes/functions.php on line 1219

WordPress

94

I searched for that error message, but did not find anything useful. I looked at source files mentioned, but I am not very familiar with PHP, so no luck there too.

Then I remembered that I had problems previously after upgrading because Wordpress did not have permission to write to upload folder. I checked it and yes, that was the problem. I fixed permissions and upload worked again.

I am just surprised how error message did not say that Wordpress does not have permission to write to a folder, but something about headers. I thought that not having permission is one of the common scenarios.

3 Comments »

  1. Ben said,

    July 27, 2007 at 9:51 pm

    Thanks Željko, that was really helpful piece of information - there was nothing I could find on the Wordpress forums to fix this problem, and then I tried your solution, and after a few days of mucking around with the issue, it was fixed in about 30 seconds.

    A gem of a piece of information!

    Thanks!

    Ben
    http://www.shotbro.com

  2. Željko Filipin said,

    July 28, 2007 at 10:09 am

    Glad I could help. :)

  3. Željko Filipin said,

    August 19, 2008 at 5:31 pm

    Found another solution.

    http://codex.wordpress.org/Answers-Troubleshooting#Headers_already_sent

Leave a Comment