Forum

Thread tagged as: Error, Addons, Blog

Blog Preview Post PHP Session Notice

Hi,

when viewing a draft blog post in preview mode we are experiencing a session error notice in the perch runtime.php. The error message we are getting is:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/elkingto/public_html/news/post.php:1) in /home/elkingto/public_html/news/admin/core/lib/PerchSession.class.php on line 9

We have no whitespace appearing before the php include in the post.php file.

James Wigger

James Wigger 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is there any whitespace in your config.php file?

Nope, I can't see any.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is your post.php file saved as UTF8 with no BOM?

I'm not entirely sure how to check that out thoroughly. Using file -I returns that it is UTF-8, and I've re-saved using sublime-text as UTF8 to be sure and the notice is still there.

$ file -I post.php
post.php: text/html; charset=utf-8
Drew McLellan

Drew McLellan 2638 points
Perch Support

The simplest way is to re-save it with that encoding. It looks likely that it has a BOM.

That seems to have sorted the issue out. Re-saved with different encoding and the notice has gone. Thanks Drew.