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