2

When i run this command i got error

php bin/magento maintenance:enable

PHP Deprecated: Return type of phpseclib_mcrypt_filter::filter($in, $out, &$consumed, $closing) should either be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/phpseclib/mcrypt_compat/lib/mcrypt.php on line 1107

PHP Deprecated: Return type of phpseclib_mcrypt_filter::onCreate() should either be compatible with php_user_filter::onCreate(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/phpseclib/mcrypt_compat/lib/mcrypt.php on line 1158

asked May 19, 2022 at 7:24
2
  • Have you found any solution of this problem? Commented Nov 29, 2022 at 12:59
  • run composer update Commented Oct 20, 2023 at 8:35

3 Answers 3

1

mcrypt module is depricated and seems to be enforced from php 8.1

Try below steps-

  1. Check if mcrypt module is there using

    php -m

  2. If mcrypt module is listed, disable it in php8.1

  3. Restart php

  4. Verify magento cmd now.

answered May 19, 2022 at 8:28
1
  • I don't have mcrypt module listed. What should I do then? And I am using docker container. Commented Nov 9, 2022 at 11:47
0

First update the mcrypt module which is compatible with php 8.1

Check Here - https://github.com/phpseclib/mcrypt_compat

answered May 21, 2022 at 8:44
0

add below line above function defination at line 1107

#[\ReturnTypeWillChange]
public function filter($in, $out, &$consumed, $closing)
{
answered May 22 at 8:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.