Uncaught Exception: Serialization Of 'closure' Is Not Allowed

Hello,

After 4.3.8 upgrade, when access the front end I got the error:

PHP Fatal Error
Message

Uncaught Exception: Serialization of 'Closure' is not allowed in public_html\app\Tygh\Backend\Cache\File.php:27

Stack trace:
#0 public_html\app\Tygh\Backend\Cache\File.php(27): serialize(Array)
#1 public_html\app\Tygh\Registry.php(398): Tygh\Backend\Cache\File->set('debugger', Array, Array, 'cache_customerd...')
#2 public_html\app\Tygh\Registry.php(80): Tygh\Registry::_saveCache('dbg_1465907646_...', Array)
#3 public_html\app\Tygh\Debugger.php(327): Tygh\Registry::set('dbg_1465907646_...', Array)
#4 public_html\app\functions\fn.control.php(632): Tygh\Debugger::display()
#5 public_html\index.php(25): fn_dispatch()
#6 {main} thrown

Error at

public_html\app\Tygh\Backend\Cache\File.php, line: 27

Back end seems working fine.

A bit research tell me that there is anonymous functions cannot be serialized, but I don't know where to debug this.

Has anyone faced this problem before and solved it?

I tested after a few upgrades from 4.3.6 to 4.3.7 to 4.3.8 so not sure what has caused this.

Mike

What PHP version are you using?

That file has not changed in the last few upgrades.

What PHP version are you using?

That file has not changed in the last few upgrades.

Thanks. I am running PHP Version 7.0.7, Windows 8.1 localhost

On my beta server, CS-Cart 4.3.5 running PHP 7.0.5 fine (Cent OS 7.2)

Do you think the data being put in serialize has anonymous function in upstream stack?

Hard to say. Try clearing cache (/var/cache/).

Hard to say. Try clearing cache (/var/cache/).

Thanks. I have tried that. After checking it caused by the debug tries to serialize data to a file and the template I use (vivashop) is using closure in their template vars. I commented out the line to pass the exception but looks like the template does not support 4.3.8 yet anyway.

I gave up and reverted to 4.3.6 which is still working fine.

Cheers!

Hi, I'm having the same problem here after change of host server.

I'm not using the same template and I don't know how to fix this.

Can someone help me?

This is the error

PHP Fatal Error

Message

Uncaught Exception: Serialization of 'Closure' is not allowed in /home/clients/ea90795ceba7e9832bf378fd457a3b14/web/app/Tygh/Backend/Cache/File.php:27 Stack trace: #0 /home/clients/ea90795ceba7e9832bf378fd457a3b14/web/app/Tygh/Backend/Cache/File.php(27): serialize(Array) #1 /home/clients/ea90795ceba7e9832bf378fd457a3b14/web/app/Tygh/Registry.php(398): Tygh\Backend\Cache\File->set('debugger', Array, Array, 'cache_customerd...') #2 /home/clients/ea90795ceba7e9832bf378fd457a3b14/web/app/Tygh/Registry.php(80): Tygh\Registry::_saveCache('dbg_1530120716_...', Array) #3 /home/clients/ea90795ceba7e9832bf378fd457a3b14/web/app/Tygh/Debugger.php(327): Tygh\Registry::set('dbg_1530120716_...', Array) #4 /home/clients/ea90795ceba7e9832bf378fd457a3b14/web/app/functions/fn.control.php(632): Tygh\Debugger::display() #5 /home/clients/ea90795ceba7e9832bf378fd457a3b14/web/index.php(25): fn_dispatch() #6 {main} thrown

Error at

app/Tygh/Backend/Cache/File.php, line: 27

Backtrace