Getting some mcrypt warnings after I pulled 20.x yesterday we are on php 7.2.33
Am I missing something?
Deprecated: Function mcrypt_module_open() is deprecated in public_html/lib/Varien/Crypt/Mcrypt.php on line 74
Deprecated: Function mcrypt_enc_get_iv_size() is deprecated in public_html/lib/Varien/Crypt/Mcrypt.php on line 83
Deprecated: Function mcrypt_create_iv() is deprecated in public_html/lib/Varien/Crypt/Mcrypt.php on line 83
Deprecated: Function mcrypt_enc_get_key_size() is deprecated in public_html/lib/Varien/Crypt/Mcrypt.php on line 87
Deprecated: Function mcrypt_generic_init() is deprecated in public_html/lib/Varien/Crypt/Mcrypt.php on line 94
Deprecated: Function mdecrypt_generic() is deprecated in public_html/lib/Varien/Crypt/Mcrypt.php on line 130
Deprecated: Function mdecrypt_generic() is deprecated in public_html/lib/Varien/Crypt/Mcrypt.php on line 130
Funny. I am missing these files and this code in latest 20.x pull ... https://github.com/OpenMage/magento-lts/commit/ce5c2026e4f23add68f5615db3b8839b60e84b4d
https://github.com/OpenMage/magento-lts/commit/ce5c2026e4f23add68f5615db3b8839b60e84b4d
OK I have learnt some things and I think it is good to share here; also 1 remaining question then this issue can be closed ;)
Learnings
php --ini | grep mcryptSince Magento 19.4.x with php 7.2 support the phpseclib lib and mcryptcompat methods have been introduced as a fall back for the deprecation of mcrypt. Important to know is that mcryptcompat will only be used if you disable mcrypt via your ini settings and restart php. Otherwise mcryptcompat will not be used. Btw mcryptcompat is required in the header lines of app/mage.php.
Fixing it
error_reporting(0); to the top of lib/Varien/Crypt/Mcrypt.phpAfter disabling mcrypt via the php ini files we saw Magento falls back on mcryptcompat.
Mcryptcompat sources can be found here https://github.com/phpseclib/mcrypt_compat and phpseclib3 here https://github.com/phpseclib/phpseclib - but there are some changes so dont just upgrade
I am closing this issue now
@seansan do you find any performance changes between using the two?
Not tested. But would be msecs I guess
On Tue, 6 Oct 2020 at 18:32, Joshua Dickerson notifications@github.com
wrote:
@seansan https://github.com/seansan do you find any performance changes
between using the two?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/OpenMage/magento-lts/issues/1211#issuecomment-704399937,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAE7I275PKYSEWAZLVWFZJTSJNBDBANCNFSM4RON2O3Q
.
I think someone tested at some point and of course it depends on how many times you call it but it wasn't insignificant. Could you just disable E_DEPRECATED in production?
Could you just disable E_DEPRECATED in production?
What do you mean?
On Wed, 7 Oct 2020 at 11:54, Colin Mollenhour notifications@github.com
wrote:
I think someone tested at some point and of course it depends on how many
times you call it but it wasn't insignificant. Could you just disable
E_DEPRECATED in production?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/OpenMage/magento-lts/issues/1211#issuecomment-704826998,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAE7I24F7Q6KZQACWPZBZD3SJQ3F5ANCNFSM4RON2O3Q
.
Use the PECL mcrypt lib and disable E_DEPRECATED
Could you just disable E_DEPRECATED in production?
What do you mean?
Set the error_reporting value to not show E_DEPRECATED. For example this is the default php.ini:
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Stated differently: just because there is a deprecation warning doesn't mean you have to immediately cease using the code, you can just ignore the warning.. :)
yeah we did that; but I still saw the error warning sometimes, I think if
certain function calls were made directly in the original php code
On Wed, Oct 7, 2020 at 6:38 PM Colin Mollenhour notifications@github.com
wrote:
Could you just disable E_DEPRECATED in production?
What do you mean?Set the error_reporting value to not show E_DEPRECATED. For example this
is the default php.ini:; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICTStated differently: just because there is a deprecation warning doesn't
mean you have to immediately cease using the code, you can just ignore the
warning.. :)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/OpenMage/magento-lts/issues/1211#issuecomment-705056314,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAE7I2YZG5LE7VMB7NR7OSLSJSKOVANCNFSM4RON2O3Q
.