mcrypt_encrypt(): Key of size 19 not supported by this algorithm


Have you ever had an error like this on laravel 4 : 'mcrypt_encrypt(): Key of size 19 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported' ? how to fix this problem?

The error message could be saying different key of size  'mcrypt_encrypt(): Key of size 11/12/15/19 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported', but it's basically the same.

This problem can be solved easily using php artisan command, so go ahead open your terminal/ console/ command promopt, navigate to your laravel project directory and run this:

php artisan key:generate

If you get permission denied message, then run it with sudo command if you are on ubuntu, just like this:

sudo php artisan key:generate


~ Good luck ~


EmoticonEmoticon