Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Script-Fu

Eleazar's post from PS as he is gone now :( Adapting PrestaShop 1.5.6 and 1.6.1x to PHP 7.2

Recommended Posts

***Please disregard the PS 1.5.x versions as that does not have any bearing on the TB eCommerce system. I'm trying to convert the files Eleazar provided hopefully for use with TB.***

-----------

For those of you who don't want to miss their smooth running PrestaShop 1.5.6 and want or need to upgrade to PHP 7.2, here are the essential fixes for download.

Sometimes there are just small changes. Larger modifications were mainly necessary in tools and classes, also for the editor TinyMCE.

The class Rijndael (classes/Rijndael.php) has to be replaced by a patched one that switches to Open SSL in case the mcrypt extension of PHP 7.2 is not installed. This is no longer the case with 7.2 by default. I'd recomend to use the Rijndael.php which is included since PrestaShop 1.6.1.18. Nevertheless PrestaShop 1.5 would steadfastly refuse to keep Rijndael active (you find the radio button at the bottom of the Back Office menu Advanced settings --> Performance) and always wants to switch to Blowfish. This requires a little trick for both PrestaShop 1.5 and 1.6: The Boolean variable PS_CIPHER_ALGORITHM in the database table ps_configuration has to be set to 1. This can be done with PHPMyAdmin, either directly by an input in the corresponding field, or in the SQL window by entering the following command:

 UPDATE `ps2_configuration` SET `value` = 1 WHERE `name` = 'PS_CIPHER_ALGORITHM' `ps2_configuration`.

However, this is already the only database intervention required.

Smarty has provided an upgrade for PHP 7.2, but this is not backward compatible. So you should really just make the fixes you find in the zip files.

For conservative results, here's a short guide to how to proceed:

  1. Switch your shop to maintenance mode. Don't forget to enter your own IP so that you can continue to access your shop front.
  2. In the config/settings.inc.php switch on the debug mode (from false --> true).
  3. Backup all originals of patched files from your shop prior to patching.
  4. Check if one or the other file is overridden. Then the changed code must be always be fixed in the Override.
  5. After importing the patched files, test the shop in any way and check out all payment methods once.
  6. Be sure to also test the behavior of - if available - third-party modules or a third-party theme (e.g. Sunnytoo’s Transformer theme needs some fixes)!
  7. For frontend and backend tests the following applies: Messages like "Notice" or "Warning" can normally be ignored, but you should carefully make a note of any error message ("Error") with the place (file, line) where it was found and the hint for modifying it. If you don't know what to do here, you can report the error message - and please only errors! - in this topic.

For security reasons, the download is provided with a checksum, whose validity you can check by double-clicking on the sha256 file in the mantle zip file. (Of course on your home PC before the upload).

Download all files here: PS 1562 modified for PHP 7.2.zip

These patch files were tested and work like a charm in production mode in PrestaShop 1.5.6.1 and 1.5.6.2. Nevertheless I don't want to rule out to have forgotten something - so critical reviews are welcome!

**************************************************************

 Changes for PrestaShop 1.6

EDIT: In PrestaShop 1.6 there are fewer changes, but these should also be better incorporated to avoid unpleasant surprises.PS 1.6.1x Umstellung auf PHP 7.2.zip Here is a summary of all major core changes for download: PS 1.6.1x Umstellung auf PHP 7.2.zip

Please read the readme.txt included in the Download before uploading the contents of the zip file to your PrestaShop 1.6!

PS 1.6.1x Umstellung auf PHP 7.2.zip

  • Like 1

Share this post


Link to post
Share on other sites

The only file that you can download is the one at the very bottom for PS 1.6.1x

I felt this was an important post on PS forum which is no longer their as Eleazar has left the building. 

So i found it in Google Cache and re-posted here in the tip/trick section.

If the powers that be do not approve then slay the post by the way side then!

_Bill

Edited by Script-Fu

Share this post


Link to post
Share on other sites

Impressive efforts. I wish I could get people into giving a migration to thirty bees at least a try. There one gets all this, and is safe for the coming future.

Share this post


Link to post
Share on other sites

@Traumflug I thought TB wasn't compatible with PHP 7.2 yet? I know the devs here are on track to make it so!

I posted those files to give a little life/time to PS 1.6.1x while getting my migration to TB 100% straight. 

Share this post


Link to post
Share on other sites

@Script-Fu thirtybee core is fully compatible. I'm running my production site on 7.2 without any problems,... the only minor issue is some notices and warnings in error logs, but these are safe to ignore

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...