Prestashop | failed to open stream | headers already sent by

I recently had a very big bug.

with debugging lines both in the back Office and the front office such as :

/cache/cachefs [function.file-put-contents]: failed to open stream: No such file or directory in /classes/CacheFS.php on line 51

Warning: Cannot modify header information - headers already sent by (output started at

As stated in THE guide. Don’t panic.

It came out in my case when in the Back Office, I’ve deactivated the cache, and forced the recompilation (because of a theme and homepage change)

So

1°) For the Front office : Edit settings.php

Go on your ftp, and edit your settings.php in your config folder.
set:

define('_PS_CACHE_ENABLED_', '1');

to

define('_PS_CACHE_ENABLED_', '0');

Ceci résoud le pb en FRONT office.

2°) For the Back Office this solved my pb.

In my favorite text editor, I had to change encoding to UTF-8, it was in ‘WESTERN Mac OS Roman’ of the file /classes/Tools.php

Reupload/publish the file if you are working locally, or just save it if you’re working on the online file. (you’d better work locally and upload or redownload the file so that local and online files are both with the same encoding)

Very helpfull Sources :

http://www.prestashop.com/forums/topic/120659-backoffice-shows-errors/

http://www.prestashop.com/forums/topic/83462-solvedwarning-cannot-modify-header-information/

http://www.prestashop.com/forums/topic/84689-solved-help-shop-shows-blank-pages/

Olivier
About

Product and graphic designer turned to be a Mac SysAdmin.

Posted in Design, Development Tagged with: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>