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
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 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.
I need to upload my symfony 3 project online, but I have only access to ftp. So I did all necessary steps I found:
composer update
Clear the cache for production: php app/console cache:clear --env=prod
Upload all app folder on server
After I open my website I got the following error:
Fatal error: require(): Failed opening required
'/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/zorbfutbal.sk/web/var..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php'
(include_path='.:/usr/php56/lib/php') in
/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/zorbfutbal.sk/web/var/bootstrap.php.cache on line 1780
I checked the file and I have it there and also set all permissions.
What is confusing me is that path from error before my actual domain name.
"/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/"
I dont know where it comed from and how to fix it.
Any idea? Thanks
You are absolutely sure you set the file permissions correctly like indicated here:
http://symfony.com/doc/current/setup/file_permissions.html#using-acl-on-a-system-that-supports-setfacl-linux-bsd
The message you posted seems to point to something like that.
Also run:
php bin/symfony_requirements
just to check that you've met all the other requirements.
I am trying to put my laravel project "live" but I am failing. I will start at the begin I got a VPS installed a LAMP stack, installed composer and VSFTPD. Went to /var/www/html and did a git clone of my repo. Changed apache to point to the correct directory, chmoded the storage folder and finally went to my server in the browser and got greeted by 2 Whoops, looks like something went wrong. After that I decided to check storage/logs/laravel.log and saw the following error:
exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/html/laravel/bootstrap/cache/compiled.php:7658
and decided to do a php artisan key:generate and got this output Application key [base64:(key was here but removed it here for obvious reasons)] set successfully.. And checked again and got greeted by the same 2 Whoops, looks like something went wrong.
Right now i have no idea what to do anymore any help is greatly appreciated.
You should have the default cypher in config/app.php as 'AES-256-CBC'. It requires a 32 character string, but the default key is "SomeRandomString," which is only 16 characters.
Either you change the cypher to 'AES-128-CBC' that works well with 16 character key, or you generate a new 32 character string for the key.
Do 'php artisan key:generate' on the command line. This will generate the proper key for you.
Update: Cache compiled had issues and a php artisan clear-compiled fixed it.
I deployed my Laravel 4.1 app in Heroku by following this article http://phpartisan.tumblr.com/post/71580870739/running-laravel-4-on-heroku
The static HTML homepage loaded okay but when I am trying to log-in, I am getting the error
SQLSTATE[HY000] [2002] No such file or directory
My local setup is Laravel 4.1 & MySQL.
I don't think there was a database created when I deployed.
Do I need to do it manually? How and what will be my settings then?
thanks!
The problem could be your environment might still point to local. in cli, type heroku run php artisan env to find out.
else, you might wanto run php artisan migrate --env=production to set it to the correct production environment.
you might then encounter another issue like this:
PHP Fatal error: Call to undefined function Symfony\Component\Console\mb_convert_variables() in /var/www/mysite/vendor/symfony/console/Symfony/Component/Console/Application.php on line 1154
Trust me, tt has nothing to do with mb_string module like what this post stated.
Laravel: Call to undefined function Symfony\Component\Console\mb_convert_variables()?
The problem is at environment setting.
First, make sure you have .env.php file at same dir level with composer.json and it is exists in your heroku instance. Since you cant FTP inside, you need to push to repo. But laravel tell you this is git ignored, so you will need to temporary allow it to push to your heroku repo.
Next, you will need to edit the bootstrap\start.php
replace the $env = $app->detectEnvironment(function(){}) to:
$env = $app->detectEnvironment(function() {
return file_exists(dirname(__FILE__) . '/../.env.php')
?
'production'
:
'local';
});
Once you done all these, rerun the migrate command and it will works.
You may follow this link for reference.
Laravel environment config not loading, migration fails - SQLSTATE[HY000] [2002] No such file or directory