Home > Backend Development > PHP Tutorial > PHP example-How to solve laravel 5.1 error: No supported encrypter found

PHP example-How to solve laravel 5.1 error: No supported encrypter found

微波
Release: 2023-03-11 18:30:01
Original
1480 people have browsed it

This article mainly introduces you to the relevant information about solving laravel 5.1 error: No supported encrypter found. The introduction in the article is very detailed and has certain reference and learning value for everyone. It is needed Friends can refer to it, let’s take a look below.

This article mainly introduces the method to solve the laravel 5.1 error: No supported encrypter found. It is shared for your reference and learning. Let’s take a look at the detailed introduction:

Problem description

When using laravel5.1 for project development, the error message "No supported encrypter found. The cipher and/or key length are invalid." appeared, resulting in the page unable to display.

Most of the answers on the Internet are to directly execute PHP artisan key:generate. Some people find it works, and some don't.

Solution

The first step to solve 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 solved by generating a new key and then restarting nginx and php-fpm. The new key generated at this time will be written directly into the .env file.

2. But if the cipher is another value, such as rijndael-256, you need to install and start the mcrypt module. The reason why AES-256-CBC is not needed is because the underlying layer corresponding to the AES-256-CBC algorithm is implemented using openssl and has nothing to do with mcrypt. rijndael-256 relies on the mcrypt module.

Check whether mcrypt is installed. The method can be to execute php -r "<a href="//m.sbmmt.com/wiki/1362.html" target="_blank">print</a>_r(<a href="//m.sbmmt.com/wiki/809.html" target="_blank">mcrypt_list_algorithms</a>());"Whether there is an output result, or another way is to check<a href="//m.sbmmt.com/wiki/660.html" target="_blank">phpinfo</a>()Information.

Start the mcrypt module if it is already installed.

The method is to execute: php5enmod mcrypt

Finally restart nginx and php-fpm

Summary

The above is the detailed content of PHP example-How to solve laravel 5.1 error: No supported encrypter found. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template