Hi
I was performing Opencart switch to https protocol on Opencart 1.5.6.x after which now I am having problem when I want to login to admin page.
Admin page is displaying this error:
Notice: unserialize(): Error at offset 687 of 8748 bytes in /home/xxxx/public_html/admin/index.php on line 51
This code is on line 51:
$config->set($setting['key'], unserialize($setting['value']));
How can I fix this problem ?
Thanks
I was performing Opencart switch to https protocol on Opencart 1.5.6.x after which now I am having problem when I want to login to admin page.
Admin page is displaying this error:
Notice: unserialize(): Error at offset 687 of 8748 bytes in /home/xxxx/public_html/admin/index.php on line 51
This code is on line 51:
$config->set($setting['key'], unserialize($setting['value']));
How can I fix this problem ?
Thanks
Last edited by dxer on Thu Dec 21, 2017 2:35 am, edited 1 time in total.
If you wish to do this without upgrading, replace all instances of:
with:
and:
replace with:
This should rectify the problem.
Although, I would still recommend to upgrade as well as your PHP version along with mySQL.
Code: Select all
serialize
Code: Select all
json_encode
Code: Select all
unserialize
Code: Select all
json_decode
Although, I would still recommend to upgrade as well as your PHP version along with mySQL.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
You mean all instances in admin/index.php file ?
there is only one "serialized" and one "unserialize" and i replaced like you said but then error is:
Notice: Undefined index: json_encode in /home/xxxx/public_html/admin/index.php on line 48
this is complete code from index.php
foreach ($query->rows as $setting) {
if (!$setting['serialized']) {
$config->set($setting['key'], $setting['value']);
} else {
$config->set($setting['key'], unserialize($setting['value']));
}
}
there is only one "serialized" and one "unserialize" and i replaced like you said but then error is:
Notice: Undefined index: json_encode in /home/xxxx/public_html/admin/index.php on line 48
this is complete code from index.php
foreach ($query->rows as $setting) {
if (!$setting['serialized']) {
$config->set($setting['key'], $setting['value']);
} else {
$config->set($setting['key'], unserialize($setting['value']));
}
}
Your PHP version might be very outdated. I would not suggest to run a live store in those conditions until upgrading your PHP version, mySQL version to mySQLi library as well as your OC version. Contact your host to upgrade the first two libraries to the most recent possible versions.
Those changes are for the entire platform. Not just index.php file.
Those changes are for the entire platform. Not just index.php file.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
For now I just need to fix this error. It was all working fine before I switched to https protocol. So , how can I fix this ?
PHP on server is 5.6.31 , mySQL is 5.5.57, this all should be fine for Opencart 1.5.6.x , I mean it was all working fine.
Is there a easy way to upgrade Opencart 1.5.6.x to Opencart 2 ?
PHP on server is 5.6.31 , mySQL is 5.5.57, this all should be fine for Opencart 1.5.6.x , I mean it was all working fine.
Is there a easy way to upgrade Opencart 1.5.6.x to Opencart 2 ?
Between v1.5x releases and v2.x releases, those are the longest to upgrade but it can be done. If you do not wish to take any chances to do the process on your own and acquire assistance, it can also be done as a custom job.Is there a easy way to upgrade Opencart 1.5.6.x to Opencart 2 ?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: Google [Bot] and 116 guests