Closed drt420 closed 6 years ago
Give a write access to storage and cache directories
sudo chmod -R 775 /var/www/laravel/storage
sudo chmod -R 775 /var/www/laravel/bootstrap/cache
Still Not Working?
If the above steps are still not working, you can try to run the following commands in the shell:
# 1. Clear Laravel cache
php artisan cache:clear
# 2. Delete the compiled class
php artisan clear-compiled
# 3. Regenerate the composer autoload file
composer dump-autoload
Hello I have done the above steps but still I am getting same error.
Give me the output of ls -l /var/www/laravel
My files are under /var/www/html directory, here is the output.
root@2:~# ls -l /var/www/html
total 2376
-rw-r--r-- 1 root root 3220 Dec 18 15:37 CODE_OF_CONDUCT.md
-rw-r--r-- 1 root root 707 Dec 18 15:37 CONTRIBUTING.md
-rw-r--r-- 1 root root 133 Dec 18 15:37 ISSUE_TEMPLATE.md
-rw-r--r-- 1 root root 35147 Dec 18 15:37 LICENSE
-rw-r--r-- 1 root root 5567 Dec 18 15:37 README.md
drwxr-xr-x 11 root root 4096 Dec 18 15:37 UNIT3D
-rw-r--r-- 1 root root 26 Dec 18 15:37 _config.yml
drwxr-xr-x 15 root root 4096 Dec 18 15:37 app
-rwxr-xr-x 1 root root 1635 Dec 18 15:37 artisan
drwxr-xr-x 3 root root 4096 Dec 18 15:37 bootstrap
-rwxr-xr-x 1 root root 1855013 Dec 18 15:38 composer
-rwxr-xr-x 1 root root 490 Dec 18 15:37 composer-setup.sh
-rwxr-xr-x 1 root root 2151 Dec 18 15:37 composer.json
-rw-r--r-- 1 root root 196471 Dec 18 15:37 composer.lock
drwxr-xr-x 2 root root 4096 Dec 18 15:56 config
drwxr-xr-x 5 root root 4096 Dec 18 15:37 database
-rw-r--r-- 1 root root 246247 Dec 18 15:37 package-lock.json
-rwxr-xr-x 1 root root 1050 Dec 18 15:37 package.json
-rwxr-xr-x 1 root root 1026 Dec 18 15:37 phpunit.xml
drwxr-xr-x 8 root root 4096 Dec 18 15:37 public
drwxr-xr-x 4 root root 4096 Dec 18 15:37 resources
drwxr-xr-x 2 root root 4096 Dec 18 15:37 routes
-rwxr-xr-x 1 root root 566 Dec 18 15:37 server.php
drwxrwxrwx 5 root root 4096 Dec 18 15:37 storage
drwxr-xr-x 50 root root 4096 Dec 18 15:39 vendor
-rwxr-xr-x 1 root root 555 Dec 18 15:37 webpack.mix.js
I think chmod 777 did the trick but still getting following error.
(1/1) RuntimeExceptionThe only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
--
in Encrypter.php (line 43)
at Encrypter->__construct('', 'AES-256-CBC')in EncryptionServiceProvider.php (line 27)
at EncryptionServiceProvider->Illuminate\Encryption\{closure}(object(Application), array())in Container.php (line 726)
at Container->build(object(Closure))in Container.php (line 608)
Run: php artisan key:generate
I have already generated key but still getting same error.
What's the output of php artisan key:generate
?
Output is as below
root@2:/var/www/html# php artisan key:generate
Application key EDIT: REMOVED set successfully.
just make sure the output matches what was written to the .env
if not paste your {YOUR APP KEY} into the .env under APP_KEY
Yeah, have you made an .env
file?
Also I'm assuming since you posted your app key here your install for UNIT3D is for demo purposes only and not production. Never share your app key.
I regenerated the key, .env output is as below. Yes, it a demo only once I am finish with testing I will start prod server.
APP_ENV=local
APP_KEY=YOUR_APP_KEY
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_LOG=daily
APP_URL=http://127.0.0.1
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nbt
DB_USERNAME=root
DB_PASSWORD=Oct@2014
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=Oct@2014
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_NAME=
DEFAULT_OWNER_NAME=UNIT3D
DEFAULT_OWNER_EMAIL=unit3d@none.com
DEFAULT_OWNER_PASSWORD=UNIT3D
I've changed the APP_URL to http://127.0.0.1 and removed the APP_KEY as it might have contained sensitive data.
in your env delete the key after APP_KEY=
Push new env to server. Then run php artisan key:generate
make sure new output matches env. If so and still error make sure
/config/app.php
line 117-119 looks like so
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
Still same error, do you have skype where we can discuss more about it
you can join https://discord.gg/T2YPNPZ and visit the #support channel
EDIT: My colleague has informed me that my previous remark was irrelevant, because the key had been removed for privacy. "Mah bad!"
@drt420 What is the output of stat .env
? It seems clear that your .env
is present, the key is set, yet it can't be read. The most obvious reason for this is that you were operating as the root
user and did something like cp env.example .env
, but your web-server is not running as root (thank goodness). This might also explain your earlier troubles with the storage directories.
Also, setting permissions to 777
is (almost) never the answer. If the site is connected to the Internet at all, that will bite you. You should use 750, 770, or 775, depending, but never 777. If using 777 is the only way it works, then the user and/or group should be adjusted instead. Maybe you are working locally, and you don't care; just figured I would mention it.
@drt420 any updates? Can I close this?
This has been resolved, Thanks for all the support
Hello Installation was done successfully but when I am opening site I am getting following error.