1

I'm trying to deploy my magento 2 project on ubunto ec2 instance and when I'm trying to access the website I get the following error

Exception: Deprecated Functionality: Function mcrypt_enc_get_iv_size() is deprecated in /var/www/html/yourParts/lib/internal/Magento/Framework/Encryption/Crypt.php on line 62 in /var/www/html/yourParts/lib/internal/Magento/Framework/App/ErrorHandler.php:61 Stack trace: #0 /var/www/html/yourParts/lib/internal/Magento/Framework/Encryption/Crypt.php(62): Magento\Framework\App\ErrorHandler->handler(8192, 'Function mcrypt...', '/var/www/html/y...', 62, Array) #1 /var/www/html/yourParts/lib/internal/Magento/Framework/Encryption/Encryptor.php(401): Magento\Framework\Encryption\Crypt->__construct('c79f46c31f6ec38...', 'blowfish', 'ecb', false) #2 /var/www/html/yourParts/lib/internal/Magento/Framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('c79f46c31f6ec38...', 0, false) #3 /var/www/html/yourParts/app/code/Magento/Config/Model/Config/Backend/Encrypted.php(109): Magento\Framework\Encryption\Encryptor->decrypt('PayPal') #4 /var/www/html/yourParts/var/generation/Magento/Config/Model/Config/Backend/Encrypted/Interceptor.php(37): Magento\Config\Model\Config\Backend\Encrypted->processValue('PayPal') #5 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Config/MetadataConfigTypeProcessor.php(88): Magento\Config\Model\Config\Backend\Encrypted\Interceptor->processValue('PayPal') #6 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Config/MetadataConfigTypeProcessor.php(106): Magento\Framework\App\Config\MetadataConfigTypeProcessor->processScopeData(Array) #7 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Config/PostProcessorComposite.php(34): Magento\Framework\App\Config\MetadataConfigTypeProcessor->process(Array) #8 /var/www/html/yourParts/app/code/Magento/Config/App/Config/Type/System/Reader.php(73): Magento\Framework\App\Config\PostProcessorComposite->process(Array) #9 /var/www/html/yourParts/var/generation/Magento/Config/App/Config/Type/System/Reader/Proxy.php(95): Magento\Config\App\Config\Type\System\Reader->read() #10 /var/www/html/yourParts/app/code/Magento/Config/App/Config/Type/System.php(223): Magento\Config\App\Config\Type\System\Reader\Proxy->read() #11 /var/www/html/yourParts/app/code/Magento/Config/App/Config/Type/System.php(180): Magento\Config\App\Config\Type\System->loadDefaultScopeData('default') #12 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...') #13 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...') #14 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use_...', 'default', NULL) #15 /var/www/html/yourParts/app/code/Magento/Store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...') #16 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply() #17 /var/www/html/yourParts/lib/internal/Magento/Framework/Interception/Interceptor.php(123): Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor)) #18 /var/www/html/yourParts/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(117): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array) #19 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Http.php(185): Magento\Framework\App\Response\Http\Interceptor->sendResponse() #20 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Http.php(156): Magento\Framework\App\Http->handleDeveloperMode(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #21 /var/www/html/yourParts/lib/internal/Magento/Framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Exception)) #22 /var/www/html/yourParts/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #23 {main}

I've searched for that issue and I found that I have to downgrade php version from 7.1 to 7.0 but I need to solve the problem without downgrading magento version is 2.1.15

1 Answer 1

4

I found solution guys. I opened that file:

/var/www/html/yourParts/lib/internal/Magento/Framework/Encryption/Crypt.php

and I added @ before every mdecrypt line, like the following:

 $data = mdecrypt_generic($this->_handle, $data);

It will become:

$data = @mdecrypt_generic($this->_handle, $data);
1
  • adding @ is just a way to suppress the notice... its not a solution.
    – MSQ
    Jul 30, 2021 at 7:36

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.