English 中文(简体)
Error appearing in application after updating cakePHP library files from 1.3.0 to 1.3.1
原标题:

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 [COREcakelibscachefile.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 ?

最佳回答

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

问题回答

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
cakelibs
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.





相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签