Home Backend Development PHP Tutorial How to solve the error No supported encrypter found in laravel 5.1

How to solve the error No supported encrypter found in laravel 5.1

Jun 13, 2018 pm 02:55 PM
laravel Report an error Error message

This article mainly introduces you to the relevant information about solving the laravel 5.1 error: No supported encrypter found. The introduction in the article is very detailed and has a certain reference and learning value for everyone. Friends in need can refer to it. Let’s join together. Let's see.

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 "print_r(mcrypt_list_algorithms());"whether there is any output result, or to check the phpinfo()information.

Start the mcrypt module if it is already installed.

The method is to execute:

php5enmod mcrypt
Copy after login

Finally restart nginx and php-fpm

The above is the entire content of this article, I hope it will be helpful to everyone's learning, more Please pay attention to the PHP Chinese website for related content!

Related recommendations:

How to solve the Fatal error session_start() error in PHP

How to solve the problem of PHP based on the DateTime class Problems with Unix timestamp and date conversion

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

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP vs. Flutter: The best choice for mobile development PHP vs. Flutter: The best choice for mobile development May 06, 2024 pm 10:45 PM

PHP vs. Flutter: The best choice for mobile development

Laravel - Artisan Commands Laravel - Artisan Commands Aug 27, 2024 am 10:51 AM

Laravel - Artisan Commands

How to use object-relational mapping (ORM) in PHP to simplify database operations? How to use object-relational mapping (ORM) in PHP to simplify database operations? May 07, 2024 am 08:39 AM

How to use object-relational mapping (ORM) in PHP to simplify database operations?

Analysis of the advantages and disadvantages of PHP unit testing tools Analysis of the advantages and disadvantages of PHP unit testing tools May 06, 2024 pm 10:51 PM

Analysis of the advantages and disadvantages of PHP unit testing tools

PHP distributed system architecture and practice PHP distributed system architecture and practice May 04, 2024 am 10:33 AM

PHP distributed system architecture and practice

Comparison of the latest versions of Laravel and CodeIgniter Comparison of the latest versions of Laravel and CodeIgniter Jun 05, 2024 pm 05:29 PM

Comparison of the latest versions of Laravel and CodeIgniter

How do the data processing capabilities in Laravel and CodeIgniter compare? How do the data processing capabilities in Laravel and CodeIgniter compare? Jun 01, 2024 pm 01:34 PM

How do the data processing capabilities in Laravel and CodeIgniter compare?

PHP code unit testing and integration testing PHP code unit testing and integration testing May 07, 2024 am 08:00 AM

PHP code unit testing and integration testing

See all articles