Fixing a very broken Zen Cart when upgrading php to 5.3
Finally solved a problem that had been nagging on a site today, we found that a zen cart e commerce site was returning the white screen of death – it turned out to be the server having been upgraded to php 5.3 from 5.2.
Having searched the internet for people with similar issues, we found a few solutions that when combined together worked perfectly for us. I’m not a massive fan of zen cart or such tecchy systems, so I’m not the one to ask if you need further information from here. I’ll just show you the files I changed that made the site work again.. so PLEASE make sure you back up ALL your files before you get started, and I can’t b responsible for your site not working.
I was getting log files returning issues like this (amongst others!)
PHP Deprecated: Function set_magic_quotes_runtime() is deprecated
1. Find: “set_magic_quotes_runtime” and prefix with an ‘@’ in application_top.php
Found in: application_top.php and /admin/includes/application_top.php
2. Find “ereg(‘whatever’, $whatever)” and replace it with “preg_match(‘/whatever/’, $whatever)” don’t forget that there are added forward slashes in there, look at the code carefully.
Found in: includes/classes/db/mysql/query_factory.php
Example: “ereg(‘^[0-9]’, $key)” should be replaced by “preg_match(‘/^[0-9]/’, $key)”
3. Find “date_diff” and replace it with something like zen_date_diff
That’s all that I needed to get it working – so good luck if you try it.. let me know if it works for you.
I’ve got a list of the original links etc, so let me know if you need them. This link was the most helpful.