Solution to laravel 5.1 error: No supported encrypter found, laravelencrypter

Source: Internet
Author: User
Tags mcrypt

Solution to laravel 5.1 error: No supported encrypter found, laravelencrypter

This article describes how to solve laravel 5.1's error: No supported encrypter found. For more information, see the following:

Problem description

When laravel5.1 is used for project development, an error message "No supported encrypter found. The cipher and/or key length are invalid." is displayed, causing The page to fail to be displayed.

Most answers on the Internet are directly executed.PHP artisan key:generateYou can. Some people find it feasible and some do not solve it.

Solution

The first step to solve this problem is to check the cipher value in config/app. php:

1. If the value of cipher is AES-256-CBC, it can be solved by generating a new key and then restarting nginx and php-fpm. The new key is directly written into the. env file.

2. But if cipher is another value, such as a rijndael-256, you need to install and start the mcrypt module. The reason the AES-256-CBC is not needed is that the underlying layer of the AES-256-CBC algorithm is implemented with openssl, not mcrypt. The rijndael-256 is dependent on the mcrypt module.

Check whether mcrypt is installed. The method can be executionphp -r “print_r(mcrypt_list_algorithms());”Whether there are output results, or viewphpinfo()Information.

If the mcrypt module has been installed, start the mcrypt module.

The method is to execute:php5enmod mcrypt

Restart nginx and php-fpm.

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

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.