Page 1 of 2
Opencart Upgrade PHP 5.6 to PHP 7
Posted: Wed Mar 25, 2020 11:31 pm
by Bobbio999
Hi,
Please help.
We are running Opencart 2.1.0.1 with PHP Version 5.6.
Our host has just moved us onto a new VPS server and says we have to update the code to Versions PHP 7.1 to 7.3.
Could anybody advise what we need to do as we are now seemingly going out of business.
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Wed Mar 25, 2020 11:38 pm
by IP_CAM
Replace your
system/library/encryption.php file with this one:
https://www.opencart.com/index.php?rout ... n_id=38012
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Mar 26, 2020 12:24 am
by straightlight
Bobbio999 wrote: ↑Wed Mar 25, 2020 11:31 pm
Hi,
Please help.
We are running Opencart 2.1.0.1 with PHP Version 5.6.
Our host has just moved us onto a new VPS server and says we have to update the code to Versions PHP 7.1 to 7.3.
Could anybody advise what we need to do as we are now seemingly going out of business.
PHP v5.6+ is no longer supported by the Industry. It would be suggested to upgrade to PHP v7.3 or above.
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Mar 26, 2020 2:23 am
by Bobbio999
Thank you for the reply.
Or question is HOW do we upgrade our OpenCart to PHP 7.
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Mar 26, 2020 3:07 am
by IP_CAM
I already replied to your Question above, so, where is our Problem ?
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Mar 26, 2020 3:23 am
by Bobbio999
Hi @ IP_CAM
A million thanks.
Is it really that simple, we just replace the 1 file
....the encryption.php file (in system/library dir) with your newer version?
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Mar 26, 2020 5:57 am
by OSWorX
Bobbio999 wrote: ↑Thu Mar 26, 2020 3:23 am
Hi @ IP_CAM
A million thanks.
Is it really that simple, we just replace the 1 file
....the encryption.php file (in system/library dir) with your newer version?
As long as you do not use php 7.4 or higher, it
is the solution.
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Mar 26, 2020 11:13 pm
by Bobbio999
The PHP Version is 7.3.
Our host has to be the worst host out there TSOHost also known as GoDaddy. We are desperatley trying to move hosts, can anybody recommend a good host.
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Mar 26, 2020 11:58 pm
by OSWorX
Bobbio999 wrote: ↑Thu Mar 26, 2020 11:13 pm
The PHP Version is 7.3.
Our host has to be the worst host out there TSOHost also known as GoDaddy. We are desperatley trying to move hosts, can anybody recommend a good host.
Where are you or your business is located?
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Fri Mar 27, 2020 12:53 am
by Bobbio999
We are located in the UK. We have 7 ecommerce sites, which tsohost moved to VPS server at a cost of £1000 per annum.
Since then, nothing but issues.
Also, their support is off the charts useless. A phone number that is answered after 30 mins by a guy who sounds like he's just woke up, and all he has the authority to do is say he will escalate with the engineers. Result is you may get an email from an engineer over the next 24hours.
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Fri Mar 27, 2020 4:27 am
by IP_CAM
If you're looking for TOP Swiss Quality, check here:
Even Government Agencies, like the SWISS POST, are using it.
I use the SMART Solution, but even the STANDARD would do,
if one only uses/has a few Sites. You might check one of the
Sites, I linked below, to find out, how speedy it is.
https://www.hostpoint.ch/
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Mon Apr 06, 2020 3:32 am
by IP_CAM
Well, unaware of, if this is directly related to PHP7+, I modified some Files,
to be according latest spec's. They replace some default OC v.1.5.6.4 - 1.5.6.5_rc
Files, and they might work in older v.1.5.6.x Versions too, but I did not check
on that. It's all about the Pagination Section, where this:
Code: Select all
if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
} else {
$page = 1;
}
has been changed to this:
Code: Select all
if (isset($this->request->get['page'])) {
$page = (int)$this->request->get['page'];
} else {
$page = 1;
}
One of the Pro's might know, why it was changed to an
INT Routine,
and if it has been done, because of PHP7 , or then for some other reason ...
It's just too far out for a colorblind Coder, to understand...

But as long
as something works, and it does, it's ok with me ...
Ernie
PS: The PHP 7+
system/library/encryption.php File is already included too!
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Mon Apr 06, 2020 1:45 pm
by OSWorX
IP_CAM wrote: ↑Mon Apr 06, 2020 3:32 am
One of the Pro's might know, why it was changed to an
INT Routine,
and if it has been done, because of PHP7 , or then for some other reason ...
That is called:
typecasting.
See:
https://www.php.net/manual/de/language. ... ggling.php
And has nothing to do with php 7 (or any other version).
Just a small piece of "good" coding (as it should be always when you get a value a user might have "manipulated").
Reason?
Whenever you receive or submit a value, it could be of any type: a string, an integer an so on.
Adding here the
(int) transforms the received value in any case into an integer.
So having this (the original)
was leading in the past to errors.
That's why it is now:
p.s.: as can be read (see the link above), "typecasting" can be applied to all values.
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Tue Apr 07, 2020 12:09 am
by IP_CAM
Thank you for the Information.

Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Apr 16, 2020 11:17 pm
by IP_CAM
Dorothys wrote: ↑Sun Apr 05, 2020 10:37 pm
If your current OpenCart store already has multiple extensions, modifications, themes and custom functionality, there might be complications if you update the PHP version without making sure that everything will still work.
Well, just yesterday, I upgraded all my Grandma OC Installs, partly equipped with 100 + VqMods
among a big bunch of Modules, from PHP 7.2.x to PHP 7.3.x, without the slightest problem.
Only by trying to use PHP 7.4.x , it showed some VqMod-related Warning above the Top header
Section, the Page itself still worked. But I did not bother to make further checks, since PHP 7.3.x
will still be sufficient for some Time to come with my 1.5.6.5
Ernie
---
Those system/library/
encryption.php files should function in most OC Releases, and
that's all it takes, to make 'em work:
https://gist.github.com/IP-CAM/10e8ce67 ... 8c8af85ddc
https://www.opencart.com/index.php?rout ... n_id=34428
https://www.opencart.com/index.php?rout ... n_id=38012
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Mon Apr 20, 2020 6:58 pm
by IP_CAM
Regarding the PHP 7.4 VqMod Warning I received, mentioned above, it had nothing
to do with Opencart itself, but with my Openshop TWEAKS VqModerator, looking for
a no longer existing VqMod (vqmod/openshop/) Subdirectory, originally beeing part
of famous MaxD's OpenShop Extension, and containing the Admin-related VqMods.
But I once moved those Admin VqMods into the default VqMod Sub, and after creating
an (empty) openshop Subdirectory, even my (aged

) OC v.1.5.6.5_rc now works fine
with PHP v.7.4.4. PHP v.7.3 and less just did not bother about it, PHP 7.4.4 does ...
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Thu Apr 23, 2020 4:09 am
by IP_CAM
Just in case, should you ever receive a Warning like this:
The Line Number might be different, it depends on the VqMod Version used !

Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Sun Jun 21, 2020 11:53 pm
by Cloudy9
Bobbio999 wrote: ↑Fri Mar 27, 2020 12:53 am
We are located in the UK. We have 7 ecommerce sites, which tsohost moved to VPS server at a cost of £1000 per annum.
Since then, nothing but issues.
Also, their support is off the charts useless. A phone number that is answered after 30 mins by a guy who sounds like he's just woke up, and all he has the authority to do is say he will escalate with the engineers. Result is you may get an email from an engineer over the next 24hours.
There are some very good hosts in the UK and there are some awfully poor ones along with some terrible ones, I used to pay for hosting many many moons ago and after various bad flavours of hosting decided to rent dedicated servers and run my own, after a steep learning curve I now have no downtime, no problems or issues and it all runs smoothly, if I ever have to shout at someone and complain I just look in the mirror.
If your looking for someone very very good with dedicated servers and VPS's then take a look at Clouvider, they have equipment in London, NY and Amsterdam among others, I use the London data centre and rent Dedicated servers (un-managed), although they do offer managed solutions (I have no experience of their linux skills though). Although at £1000 a year for 7 VPS's, you get what you pay for and without knowing the specs of your existing VPS's and what your running on them and your bandwidth etc etc then its hard to say what you would need from a decent provider.......
Re: Opencart Upgrade PHP 5.6 to PHP 7 (php 7.x is dead)
Posted: Wed Nov 09, 2022 7:28 pm
by OSWorX
Just for the audience coming to this discussion: php 7.x will die on the 28th of November 2022.
From then only php 8.x (best 8.2.x) should be used!
Read:
https://endoflife.date/php
Re: Opencart Upgrade PHP 5.6 to PHP 7
Posted: Wed Nov 09, 2022 8:40 pm
by johnp
I've got a few OC 1.5.6.5_rc sites running on PHP 8.1 with no errors. They are pretty vanilla though. I'm sure V2 can run on PHP 8.1 with a bit of tweaking.