jbo14 Posted April 3, 2017 Share Posted April 3, 2017 Hello, J'utilise prestashop 1.6.1.12 avec PHP 7.1.3 et j'ai plusieurs erreurs dans les logs apache - Deprecated: Function mcrypt_decrypt() is deprecated in /var/www/html/classes/Rijndael.php on line 68 - PHP Notice: A non well formed numeric value encountered in /var/www/html/tools/pclzip/pclzip.lib.php on line 1845 => on fait des operations arithmétiques avec memory_limit qui n'est pas un numéric - PHP Notice: A non well formed numeric value encountered in /var/www/html/classes/Uploader.php on line 122 Link to comment Share on other sites More sharing options...
Eolia Posted April 3, 2017 Share Posted April 3, 2017 Ben normal, la 1.6 n'est compatible avec PHP 7 que depuis la 1.6.1.8^^ Link to comment Share on other sites More sharing options...
jbo14 Posted April 4, 2017 Author Share Posted April 4, 2017 Il me semble que la 1.6.1.12 > 1.6.1.8... C'est juste informatif, ça n'empêche pas le bon fonctionnement du code, mais ce n'est pas propre. 1 Link to comment Share on other sites More sharing options...
bitwise Posted April 6, 2017 Share Posted April 6, 2017 (edited) You are right. I'm testing PrestaShop 1.6.1.12 on PHP 7.1.1.0 and I have the same results... On 1.6.1.12 release page, we have a "change log" page (view here) where, at the core section, they said that Compatibility with 7.1 was fixed. Deprecation of "mcrypt_decrypt()" PHP function was requested and announced from the beginning of PHP7, so a solution (if any, since there is no replacement for that function) could be found until today... In Prestashop 1.7 things are better since is used open ssl encryption To get ride of those warnings provided by "pclzip.lib.php on line 1845": a) edit with a text editor the file "pclzip.lib.php" and comment out the line 1845 (put two slashes in front of the line) add the following line, just after the commented one: $v_memory_limit = preg_replace("/[^0-9.]/", "", trim($v_memory_limit)); The same for the class "Uploader.php" a) edit with a text editor the file "Uploader.php" and comment out the line 122 add the following line, just after the commented one: $bytes = preg_replace("/[^0-9.]/", "", trim($post_max_size)); This warning is provided by the way the function "ini_get" read the php.ini file. Each of those vars that trigger a Notice, are represented in PHP initialization file by a number followed by a letter (G for gigabyte, M for Megabytes and K for kilobytes. e.g post_max_size=5M). Before PHP 7, the multiplication function use to get only the numeric part of the operators. Since PHP 7 is "more strict", despite the fact that the math operation is done, a notice message is send. Those added lines eliminate any alpha character from the future operator, leaving only digits and decimal separator(if any). By modifying core files you will get a temporary solution (Not recommended). Upgrading to another version of Prestashop you will loose these modifications. For Rjindael class, things are different. You get a warning message to let you find an alternative to "mcrypt_encrypt()" and "mcrypt_decrypt()" PHP functions because, in the future PHP releases, those functions will be removed for good, so upgrading to PHP 7.2 you will not get a warning anymore but an error... Switching to Blowfish instead Rjindael encryption, in Advanced parameters > Preformance, (your cookie will be reset and the cookie encryption/decryption process is slower than Rjindael) you will not get anymore that warning. Hope this helps a little... Edited April 6, 2017 by bitwise (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now