Headers already sent

After successfully testing the new friendly newsletter creation page on my test site, I used SVN to update the theme on the live version of my site, all ready to try out the user friendly awesomeness.

Sadly, uploading files caused something similar to the following to appear.

Warning: filesize() [function.filesize]: stat failed for /usr/tmp/php5gl6gY in wp-admin/includes/ms.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at wp-admin/includes/ms.php:31) in wp-includes/pluggable.php on line 897

A phpfreaks forum thread mentions that the user must have necessary permissions. As explained in an earlier post, I’m using the cgi-wrapper to run it as my own name, and thus it probably has no permissions for the temp folder and can’t run the filesize() function.

Poking into the code for ms.php, I saw that it does the file size check if the option ‘upload_space_check_disabled’ is false.

The checkbox which controls this setting is found in Network Admin -> Settings -> Site Upload Space. Disabling the check for user space allows the uploads to go through successfully.

Note that although a headers already sent error is shown, the files are still uploaded to the server.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s