0

When I check watchdog, I have lots of PHP warnings like this:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /srv/bindings/9c42927e5316467d82a6fb1be50ed34e/code/includes/file.inc:1972) in drupal_session_start() (line 287 of /srv/bindings/9c42927e5316467d82a6fb1be50ed34e/code/includes/session.inc).

There are a lot of reports of errors like this, apparently most of which are caused by having spaces at the beginning or ends of PHP files. But in this case, I think the problem is related to file uploads for the following reason. The Location of these warnings are paths like this:

https://example.com/sites/default/files/styles/profile_pic/public/pics/41207/image.jpg?itok=cdQrU8Rv

The Referrer is my "manage pictures" page, which allows users to add a Picture content type which includes an Image field.

So, it looks like session_start() is having trouble during uploads. Is there a standard fix fox this kind of problem?

4
  • 2
    Those are image style paths, not related to uploads as such. What's happening is that when an image style is requested, a header is being sent before the request has completed, when Drupal sends the headers it's supposed to. It's often caused by a warning/error being written out to the buffer, so try making sure you have all error reporting disabled. The real error should be I your server logs if you're logging then
    – Clive
    May 31, 2015 at 12:35
  • Those look like Pantheon paths? Are the derivatives being made properly? We have run into memory limits there w/ some large images.
    – mpdonadio
    May 31, 2015 at 13:00
  • Stabdard fix? Well I'd start with scanning all files that end with PHP close tag ?>.
    – AKS
    May 31, 2015 at 14:27
  • @MPD Yes, this is on Pantheon. Based on your suggestion, I tried uploading larger images than I usually do, and I was immediately able to reproduce the error. It appears this error appears right after the image is uploaded, on the image page-- the image derivative hasn't been created yet, and then eventually it gets generated, and somehow in that process this error results. Jun 1, 2015 at 15:49

1 Answer 1

0

I'm also getting the exact same issue on a Pantheon hosted site. This is on a more complex content type (number of fields) with the image field using the multiupload_imagefield_widget module so we can upload multiple images. The error can also appear on removing an image, where the image field is updated via AJAX. Occasionally, a WSOD will occur.

Location or Path always relates to files/styles/....

Tried to duplicate this on a basic content type but it was not occurring. The issue appears on the main content type 80% of the time.

Your Answer

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

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