magento2: The errors occur using Magento 2.4.4 with PHP 8.1 on a Linux Apache server

Preconditions (*)

  1. Magento 2.4.4
  2. Php 8.1
  3. Linux apache cPanel

Steps to reproduce (*)

  1. install Magento 2.4.4 through Softaculous app installer
  2. Update Php version from 7.3 to 8.1 with the help of multiPHP manager

Expected result (*)

Demo/Default Pages and Admin Panel should display properly.

Actual result (*)

Error: Undefined constant "Magento\Framework\Encryption\Adapter\SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES" in /home4/wardyvgq/public_html/vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php:40
Stack trace:
#0 /home4/wardyvgq/public_html/vendor/magento/framework/Encryption/Encryptor.php(399): Magento\Framework\Encryption\Adapter\SodiumChachaIetf->encrypt('a:3:{s:7:"defau...')
#1 /home4/wardyvgq/public_html/vendor/magento/module-config/App/Config/Type/System.php(339): Magento\Framework\Encryption\Encryptor->encryptWithFastestAvailableAlgorithm('a:3:{s:7:"defau...')
#2 /home4/wardyvgq/public_html/vendor/magento/framework/Cache/LockGuardedCacheLoader.php(137): Magento\Config\App\Config\Type\System->cacheData(Array)
#3 /home4/wardyvgq/public_html/vendor/magento/module-config/App/Config/Type/System.php(281): Magento\Framework\Cache\LockGuardedCacheLoader->lockedLoadData('SYSTEM_CONFIG', Object(Closure), Object(Closure), Object(Closure))
#4 /home4/wardyvgq/public_html/vendor/magento/module-config/App/Config/Type/System.php(207): Magento\Config\App\Config\Type\System->loadDefaultScopeData('default')
#5 /home4/wardyvgq/public_html/vendor/magento/module-config/App/Config/Type/System.php(181): Magento\Config\App\Config\Type\System->getWithParts('default/admin/u...')
#6 /home4/wardyvgq/public_html/vendor/magento/framework/App/Config.php(132): Magento\Config\App\Config\Type\System->get('default/admin/u...')
#7 /home4/wardyvgq/public_html/vendor/magento/module-backend/App/Config.php(51): Magento\Framework\App\Config->get('system', 'default/admin/u...')
#8 /home4/wardyvgq/public_html/vendor/magento/module-backend/App/Area/FrontNameResolver.php(109): Magento\Backend\App\Config->getValue('admin/url/use_c...')
#9 /home4/wardyvgq/public_html/vendor/magento/module-backend/Helper/Data.php(209): Magento\Backend\App\Area\FrontNameResolver->getFrontName(false)
#10 /home4/wardyvgq/public_html/vendor/magento/module-backend/App/Request/PathInfoProcessor.php(50): Magento\Backend\Helper\Data->getAreaFrontName()
#11 /home4/wardyvgq/public_html/generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php(95): Magento\Backend\App\Request\PathInfoProcessor->process(Object(Magento\Framework\App\Request\Http), '/admin_backend')
#12 /home4/wardyvgq/public_html/vendor/magento/framework/App/Request/Http.php(148): Magento\Backend\App\Request\PathInfoProcessor\Proxy->process(Object(Magento\Framework\App\Request\Http), '/admin_backend')
#13 /home4/wardyvgq/public_html/vendor/magento/framework/App/Request/Http.php(163): Magento\Framework\App\Request\Http->getOriginalPathInfo()
#14 /home4/wardyvgq/public_html/vendor/magento/framework/App/Request/Http.php(213): Magento\Framework\App\Request\Http->getPathInfo()
#15 /home4/wardyvgq/public_html/vendor/magento/framework/App/Http.php(111): Magento\Framework\App\Request\Http->getFrontName()
#16 /home4/wardyvgq/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#17 /home4/wardyvgq/public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#18 /home4/wardyvgq/public_html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#19 {main}

image

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (5 by maintainers)

Most upvoted comments

This works for me works on Windows

Add “extension=sodium” to php.ini (no quotes) Copy php/libsodium.dll to apache/bin/ Restart Apache

This works for me works on Windows

Add “extension=sodium” to php.ini (no quotes) Copy php/libsodium.dll to apache/bin/ Restart Apache

Oh, it works for me, thanks @nikunjskd20

Now that issue has been solved. Actually, I installed xampp server and there was another apache installed so that made it difficult to run the magento 2.4.4. So there is no issue with lib sodium.

Thanks

On Thu, Jun 2, 2022 at 2:16 AM Ihor Sviziev @.***> wrote:

@marcelovillalta0 https://github.com/marcelovillalta0, sorry can’t help you with xampp, I can just can say that the issue coming from missing / outdated lib sodium. If you’ll fix it - the issue will be solved for you

— Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/35419#issuecomment-1143814902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVQOLYKGUO7KJX5DGFV24ITVM6EFVANCNFSM5VCIR3AQ . You are receiving this because you were mentioned.Message ID: @.***>