I'm suddenly (no changes made in the past week) getting a white screen
after (successfully) adding records, due to headers already sent. The
trouble is a couple of warnings related to persistence/caching that
I'm unable to figure out.
Unfortunately, this is only occurring on the server. I'm unable so far
to replicate this locally.
ItemsController:
public $persistModel = true;
public $uses = array(
'Item',
'ItemFile',
'ItemLink',
'ItemEmbed',
'ItemIllustration',
'Thumbnail',
'Preview'
);
The errors (everything before the last warning here is displayed twice):
-- snip --
Warning (2): Invalid argument supplied for foreach()
[CORE/cake/libs/object.php, line 283]
Code | Context
$name = "ItemLinkregistry"
$type = "registry"
$file =
"/var/www/vhosts/MYDOMAIN.com/httpdocs/app/tmp/cache/persistent/itemlinkregistry.php"
$ItemLinkregistry = "a:1:{i:0;N;}"
$vars = array(
null
)
unset($vars);
$vars = unserialize(${$name});
foreach ($vars['0'] as $key => $value) {
Object::__openPersistent() - CORE/cake/libs/object.php, line 283
Object::_persist() - CORE/cake/libs/object.php, line 232
Controller::loadModel() - CORE/cake/libs/controller/controller.php, line 516
Controller::constructClasses() -
CORE/cake/libs/controller/controller.php, line 457
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 207
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
[main] - APP/webroot/index.php, line 92
Warning (2): Cannot modify header information - headers already sent
by (output started at
/var/www/vhosts/MYDOMAIN.com/httpdocs/cake_1.2.3.8166/cake/basics.php:313)
[CORE/cake/libs/controller/controller.php, line 640]
-- snip --
My caching setup in core.php:
Cache::config(
'default', array(
'engine' => 'File',
'duration'=> 3600,
'probability'=> 100,
'path' => CACHE,
'prefix' => 'cake_',
'lock' => false,
'serialize' => true,
)
);
Things look ok in app/tmp/cache but I can't say I know how things
*should* look. I can see that itemlinkregistry.php looks very brief.
$ ls -l persistent/
total 928
-rw-rw-rw- 1 apache apache 1125 Jun 2 14:14 cake_core_core_paths
-rw-rw-rw- 1 apache apache 114 May 17 17:33 cake_core_default_en_ca
-rw-rw-rw- 1 apache apache 111 May 27 02:37 cake_core_default_eng
-rw-rw-rw- 1 apache apache 114 May 20 11:48 cake_core_default_en_gb
-rw-rw-rw- 1 apache apache 114 Jun 2 14:14 cake_core_default_en_us
-rw-rw-rw- 1 apache apache 114 May 20 12:20 cake_core_default_zh_cn
-rw-rw-rw- 1 apache apache 6571 Jun 2 14:14 cake_core_dir_map
-rw-rw-rw- 1 apache apache 5679 Jun 2 14:14 cake_core_file_map
-rw-r--r-- 1 apache apache 65216 May 17 17:32 itemembed.php
-rw-r--r-- 1 apache apache 78731 May 17 17:32 itemembedregistry.php
-rw-r--r-- 1 apache apache 65215 May 17 17:32 itemfile.php
-rw-r--r-- 1 apache apache 78730 May 17 17:32 itemfileregistry.php
-rw-r--r-- 1 apache apache 3640 May 17 17:32 itemillustration.php
-rw-r--r-- 1 apache apache 82003 May 17 17:32 itemillustrationregistry.php
-rw-r--r-- 1 apache apache 65215 May 17 17:32 itemlink.php
-rw-r--r-- 1 apache apache 43 May 17 17:33 itemlinkregistry.php
-rw-r--r-- 1 apache apache 65196 May 17 17:33 item.php
-rw-r--r-- 1 apache apache 65684 May 17 17:33 itemregistry.php
-rw-r--r-- 1 apache apache 65214 May 17 17:33 preview.php
-rw-r--r-- 1 apache apache 69311 May 17 17:33 previewregistry.php
-rw-r--r-- 1 apache apache 65216 May 17 17:33 thumbnail.php
-rw-r--r-- 1 apache apache 69313 May 17 17:33 thumbnailregistry.php
$ cat persistent/itemlinkregistry.php
<?php $ItemLinkregistry = 'a:1:{i:0;N;}' ?>
Can anyone think of some way to further debug this?
One thing I was wondering about is that I have this beforeRender()
code in the controller. This was due to problems with the client's
browser (IE6) not reflecting changes made. I thought that the warnings
and these headers may have interfered with each other. However, when I
commented that out, I still saw the white screen, so I guess it's
unrelated.. I mention it anyway in case someone knows of a better
solution.
function beforeRender()
{
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---