PHP example-Solve Laravel 5.1 error: No supported Encrypter found method

Source: Internet
Author: User
Tags mcrypt php example
This article mainly introduces to you about the solution Laravel 5.1 error: No supported encrypter found related information, the article introduced in very detailed, for everyone has a certain reference learning value, the need for friends can reference, the following to see together.

This article mainly introduces about solving Laravel 5.1 error: No supported Encrypter found method, share out for everyone to reference the study, below to see the detailed introduction:

Problem description

When using laravel5.1 for project development, there was "No supported Encrypter found. The cipher and/or key length is invalid. " Error message, causing the page to fail to display.

Most of the answers on the web are directly executed PHP artisan key:generate . Some people find it feasible and some are not solved.

Workaround

The first step in solving this problem is to look at the cipher value in config/app.php:

1. If the value of cipher is AES-256-CBC, then it can be resolved by generating a new key and then restarting Nginx and PHP-FPM. The generated new key is then written directly to the. env file.

2. However, if cipher is a different value, such as rijndael-256, you will need to install and start the MCrypt module. The reason why AES-256-CBC is not needed is that the AES-256-CBC algorithm corresponds to the underlying level that is implemented with OpenSSL and is not related to MCrypt. The rijndael-256 is dependent on the MCrypt module.

Check if MCrypt is installed. The method can be performed php -r “print_r(mcrypt_list_algorithms());” with or without output results, and there is a view of the phpinfo() information.

Start the MCrypt module if it is already installed.

The method is to execute:php5enmod mcrypt

Finally, the Nginx and PHP-FPM can be restarted.

Summarize

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.