Magento 2.4.x issues related to SODIUM on Xampp

Issue: Sodium Extension Error in Magento 2.4.5/2.4.6 After Installing XAMPP (PHP v8.1.x) on Windows

After installing XAMPP (PHP v8.1.x) on Windows, you may encounter an issue related to the sodium extension when running Magento 2.4.5 or Magento 2.4.6. The error message might look like this:

main.CRITICAL: Error: Undefined constant "Magento\Framework\Encryption\Adapter\SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES"

This error occurs because the sodium extension is not loaded.

How to Fix This Issue:

  1. Enable the Sodium Extension:

    • Open your php.ini file.

    • Search for extension=sodium.

    • Uncomment this line by removing the semicolon (;) at the beginning of the line.

  2. Copy the libsodium.dll File:

    • Copy the libsodium.dll file from xampp/php/ and paste it into the xampp/apache/bin/ directory.

  3. Restart Apache:

    • Restart Apache to apply the changes.

Verify the Fix:

To verify that the issue has been resolved, run phpinfo() in your browser. Look for the table showing the Sodium extension support. It should look similar to the screenshot below:

Magento 2.4.x issues related to SODIUM on Xampp

 

 

 

 

 

Back to Top