views:

68

answers:

3

Hi everyone,

I have just updated my cakephp library to latest version 1.3.1. Before this I was running v1.3.0 with no errors.

After running the application I am given this error message.

unserialize() [function.unserialize]: Error at offset 0 of 2574 bytes [CORE\cake\libs\cache\file.php, line 176]

I updated the libraries simply by replacing the existing cake files with the new ones downloaded from the net.

Is it the correct way of updating applications. I did'nt made any customizations to the core library of cakePHP.

What is the problem ?

Please help.

Thanks

+1  A: 

I guess you encountered the following CakePHP bug (which has been fixed in the meantime): http://cakephp.lighthouseapp.com/projects/42648/tickets/769-unserialize-error-cakephp-131-unusable-on-windows

dhofstet
+1  A: 

The link provided by dhofstet clearly explains and solves the problem, still posting an answer, so that anyone facing the same issue may not have to go outside of stackoverflow.

Open up the cakephp libs folder
path is
cake\libs
then open the file
file.php
go to line number 188
and add the following code in it
$data = trim($data); just after the following loop

while (!feof($this->handle)) {
        $data .= fgets($this->handle, 4096);
    }

like this

while (!feof($this->handle)) {
        $data .= fgets($this->handle, 4096);
    }
$data = trim($data);

This will solve the error completely.

Gaurav Sharma
The above error has now been removed in the current version 1.3.2
Gaurav Sharma
A: 

I updated to version 1.3.2 and still encountering this problem when testing my app on local windows machine.

lorro
try emptying the following directories in the "{app}\tmp\cache" folder,'models', 'persistent'and then check if it solved the problem.
Gaurav Sharma