Laravel Project Error decryptexception:the MAC is invalid.

Source: Internet
Author: User
Tags import database

1. Description of the problem



Upload the Laravel project to the server, the local database export and import to the server database, everything works fine, but when the user logon times wrong
Decryptexception in compiled.php line 13238:the MAC is invalid
Or
decryptexception in baseencrypter.php line 48:the MAC is invalid



2. Resolution process


Internet query found many people say is laravel key problem, to regenerate, clear the cache. But I tried to find out that the error
Decryptexception in compiled.php line 13238:the MAC is invalid
Become a
Decryptexception in baseencrypter.php line 48:the MAC is invalid

The problem is still unresolved.




settings:

before using Laravel encryption, you need to first config/ The key parameter in the app.php configuration file sets a value that is a string that contains 32 random characters. If this value is not set correctly, all data encrypted by Laravel is not secure.



basic usage:

encryption




3. Summary

to report the wrong Mac value is not the computer MAC address, but Laravel's encrypt encryption is related to its app_key, and each data is given a special Mac verification code.

after changing the environment, you need to regenerate key first, and then encrypt the data in the database using encrypt encryption.



This shows that once the App_key changes, the database of a large number of encrypt encrypted data will be all obsolete, which is not conducive to database migration and backup, so use hash encryption.

Laravel Project Error decryptexception:the MAC is invalid.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.