找不到支持的加密器问题

时间:2016-05-29 03:14:06

标签: php encryption laravel-5

当我在我的laravel(5.2)上发布我的表单时,我必须在前一页面返回一些值时得到这个。

MY CONTROLLER

class WsRegisterController extends Controller{

public function register()
{
    $wsregistration = Input::all();
    $wsUserName = Input::get('name');
    $wsUserEmail = Input::get('email');
    $wsUserPassword = Input::get('password');

    /* Check if user is a bot */

    $wsrules = [
    // 'g-recaptcha-response' => 'required|recaptcha', capthcha
    'name'   => 'required|min:2|max:32',
    'email'  => 'required|email',
    'password' => 'required|alpha_num|min:8'
    ];

    $wsvalidator = Validator::make($wsregistration, $wsrules);

    if ($wsvalidator->passes()) {

        /* Check if the email address exits */

        $wsUser_count = User::where('email', '=', $wsUserEmail)->count();

        // return $wsUser_count; exit;

        if ( $wsUser_count > 1 ) {

            return Redirect::to('/test')->with(array('error_msg' => 'This email address exist, please use another email address.'));

        }
     }
   }
  }

所以我尝试使用此link进行stackoverflowing,但它仍无法正常工作

CONFIG / APP.PHP文件

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/

'key' => env('o/tPhyhKmuLoJMWXZeV8b10OFoCT62z6WKuC3HO5Jbw='),// env('9TSL9BsEjZyoM9BjX9du0XaLnCDi4m4Z'),

'cipher' => 'AES-128-CBC',//'AES-256-CBC',

.ENV文件

APP_KEY=base64:o/tPhyhKmuLoJMWXZeV8b10OFoCT62z6WKuC3HO5Jbw=
APP_URL=http://localhost

我甚至做了这个工匠命令来生成新密钥php artisan key:generate请问我做错了什么@everyone。

No supported encrypter found error snapshot

1 个答案:

答案 0 :(得分:0)

感谢@everyone的支持,但我已经解决了。

'key' => '9TSL9BsEjZyoM9BjX9du0XaLnCDi4m4Z',// env('9TSL9BsEjZyoM9BjX9du0XaLnCDi4m4Z'), 'cipher' => 'AES-256-CBC',

php artisan config:cache

神奇了吗。