.
PROBLEM:
RuntimeException
No application encryption key has been specified.
SOLUTION:
1. If .env does not exist in root folder, .env.example file in the root of your project to .env or create a new .env file.
2. You should not just create empty .env file, but fill it with content of .env.example.
.envfile look like this: (Fill up with required database connection)
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_URL=http://localhost
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
.
3. In the terminal go to the project root directory(not public folder) and run
php artisan key:generate
If everything is okay, response in terminal should look like this
Application key [base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=] set successfully.
4. Check that the Application Key is inserted into .env file.
You can just copy key itself and paste it in your .env file as the value to APP_KEY. Result line should looks like this:
APP_KEY=base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=
5. In terminal run
php artisan config:cache
.
REFERENCE:
https://stackoverflow.com/questions/44839648/no-application-encryption-key-has-been-specified-new-laravel-app
Showing posts with label error. Show all posts
Showing posts with label error. Show all posts
Wednesday, October 17, 2018
Solution To: Laravel Error file_get_contents(/var/www/laravel/.env): failed to open stream
.
PROBLEM:
file_get_contents(/var/www/laravel/.env)
: failed to open stream
: No such file or directory”?
SOLUTION:
Probably you missed your .env file in laravel project folder.So make .env.example to .env file. Also give the required database connection.
.envfile look like this: (Fill up with required database connection)
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_URL=http://localhost
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
.
REFERENCE:
https://stackoverflow.com/questions/36761778/how-to-resolve-the-error-errorexception-file-get-contents-var-www-laravel-e
PROBLEM:
file_get_contents(/var/www/laravel/.env)
: failed to open stream
: No such file or directory”?
SOLUTION:
Probably you missed your .env file in laravel project folder.So make .env.example to .env file. Also give the required database connection.
.envfile look like this: (Fill up with required database connection)
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_URL=http://localhost
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
.
REFERENCE:
https://stackoverflow.com/questions/36761778/how-to-resolve-the-error-errorexception-file-get-contents-var-www-laravel-e
Solution To: Laravel Error failed to open stream: Permission denied
PROBLEM:
Laravel Error failed to open stream: Permission denied
SOLUTION:
Most folders should be normal "755" and files, "644"
Laravel requires some folders to be writable for the web server user. You can use these command on *nix based OSs.
Using ACL
// nginx = web server user
// systemuser = your local user which you use to login via ssh
sudo setfacl -Rdm u:nginx:rwx,u:systemuser:rwx storage
sudo setfacl -Rm u:nginx:rwx,u:systemuser:rwx storage
Alternatively, if you don't have ACL
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
REFERENCE:
https://laracasts.com/discuss/channels/general-discussion/laravel-framework-file-permission-security
https://stackoverflow.com/questions/30639174/file-permissions-for-laravel-5-and-others
Solution To: Whoops, looks like something went wrong. Laravel 5.0
.
PROBLEM:
I installed Laravel 5.0 properly by cloning in git, and composer install, when I ran it to browser http://localhost/laravel/public/, it says
"Whoops, looks like something went wrong."
SOLUTION:
The error logs are located in storage directory.
You need to check the error message in order to identify the cause of the error.
Subscribe to:
Posts (Atom)
Labels
apt-get
(2)
bash
(4)
Chrome
(1)
CMS
(1)
code-igniter
(1)
codenvy
(1)
composer
(6)
eclipse che
(1)
error
(4)
file-permission
(1)
firebase
(2)
Free PHP Hosting
(11)
FuelPHP
(3)
git
(4)
jwt
(1)
laravel
(10)
mysql
(1)
OpenShift
(1)
php
(11)
PHP Eclipse
(9)
PHP Joomla
(2)
PHP Laravel
(4)
PHP Yii
(9)
PHP-JBOSS
(2)
php-jwt
(2)
PHP-Wordpress
(8)
plain php
(1)
Postman
(1)
REST
(2)
sqlite
(1)
sudo
(1)
visual-studio
(4)
xampp
(4)