I am running lumen on my backend, and on the frontend I am using AJAX to make requests to the server every 5 seconds. At first the requests run fine, but after about 20 requests I get the following error:
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
In my .env file I have this:
APP_ENV=local
APP_DEBUG=true
APP_KEY=1jleJ3gqex79HZ39mP5nWgtX2u1HD8X1
What is causing this to happen and is there anyway to fix it?
One thing I read is that the file is getting locked and it isn't able to read the .env so it throws an error.
Related
I am using php 7.3.2 on window 7. When I try to run php artisan serve, it shows this error on the webpage:
Whoops, looks like something went wrong.
Is it related to the message that I received when I want to migrate database, it says
Application In Production!
My error in laravel log shows
production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in C:\xampp\htdocs\Inventory\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:43
Following the error in your log file you seem to be missing your key attribute in your .env file. See this SO question for a solution.
To generate the secret key, run
$ php artisan key:generate
make sure to follow the official docs when installing Laravel.
Your laravel is running in production mode. If you are developing local, you should switch that for your local maschine.
To do so: In your .env set the APP_ENV to local (APP_ENV=local) and try again.
Now, you will see the full error message and you are able to handle it now.
I recently uploaded my laravel blog project on 000WebHost, after that I redirected to URL http://laravelcreativeblog.000webhostapp.com/, but I saw this error Whoops, looks like something went wrong., this error is displayed two times one after the other. So I googled that and finally I reached to the a solution that there is an error in APP_KEY which I found here /public_html/storage/logs/laravel.log and error at last is:
[2018-10-18 15:44:47] production.ERROR: No application encryption key
has been specified. {"exception":"[object] (RuntimeException(code: 0):
No application encryption key has been specified. at
/storage/ssd1/217/7530217/public_html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:42)
[stacktrace]
So I generated Application Key from CMD by php artisan key:generate and put in the .ENV File but again getting that error.
This is all I done, so any suggestions???
I fixed the error the error was that 000WebHost does not support .ENV file variables, so we must add all .env detials into config/app.php file and database details into config/database.php. Read the last FAQ here, https://www.000webhost.com/forum/t/deploy-laravel-project-into-000webhost-site/127323 for more details(only for 000WebHost).
When you receive "No application encryption key" error:
be sure that you have .env file in root directory
run php artisan key:generate
I am trying to deploy my laravel project on Heroku. In the deployment steps at https://devcenter.heroku.com/articles/getting-started-with-laravel , I am asked to set the 32 char APP KEY for the application
I am really confused, that should I use the already generated APP_KEY environment variable in the .env file which is something like this:
APP_KEY=base64:3784jZeQ333utc4G8NxL9o2v6r8ct4ffTrRzFsStHrm0=
But this string is not 32 chars long, and the example in the steps clearly shows a random 32 char string.
My env app key seems to be encryted.
I already tried using this env app key, but after deploying I get error: Whoops something went wrong.
-Should I have to use the SAME key as generated in .env file ?
I re-deployed my application again and used the entire base64 string of the .env file APP_KEY environment variable. It works fine now.
I write a simple live chat converastion and works well, but in some cases,ajax request get error 500 (Internal Server Error) and the request is not complete
Record error in Laravel.log :
2017-02-28 16:49:54] production.ERROR: exception 'RuntimeException' with message 'The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.' in D:\wamp\www\***\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:43
application key was set,my ajax request works well,but in sometimes for example after 5-7 consecutive request this error occurs
where is the problem?
Application Key
The next thing you should do after installing Laravel is set your application key to a random string. If you installed Laravel via Composer or the Laravel installer, this key has already been set for you by the php artisan key:generate command.
Official Documentation
I am developing an application using anuglarJs on client side and Lumen in server side for REST API's. My .env configuration given below,
APP_ENV=local
APP_DEBUG=TRUE
APP_KEY=XrPbyRlU5p0szSw5MrAQWwWim8C0MXjT
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=kainfo
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=file
SESSION_DRIVER=file
And enabled Dotenv::load(__DIR__.'/../'); in bootstrap/app.php
My problem is,sometimes Lumen throws 500 exception and working well on next refresh request.
The Error log is ,
[2015-06-06 07:51:41] lumen.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [1044] Access denied for user ''#'localhost' to database 'forge'' in C:\xampp\htdocs\Study\kasrodinfo\web\vendor\illuminate\database\Connectors\Connector.php:47
You need to change the database,username,password in \vendor\laravel\lumen-framework\config\database.php file
Also affected by this, here is what we have found on this issue:
We were using Apache 2.4 with the Event MPM and a thread-safe build of PHP 7. This caused the env() method to not respond reliably - it could give you the right variable at one point in the code, then just a few rows down it would return something else. (Like the default variable which trevorg was experiencing.)
We switched to using the prefork MPM and the problems vanished instantly.
Yes, prefork sucks in terms of speed when compared to another MPM, but it seems there is some issue with the event MPM and environmental variables in Apache, PHP and/or Laravel/Lumen.