vimuth vimuth - 3 months ago 29
PHP Question

Unable to add laravel 5 project to subfolder

I added my laravel 5 project to shared host server using this tutorial,
http://laravel.io/forum/12-29-2015-hosting-laravel-5-on-subdomain#reply-30462

This is my file structure,

domain.com/
|--larco
|-- public_html/
| |--laravel


public/index.php in laravel folder,

require __DIR__.'/../../../larco/bootstrap/autoload.php';
$app = require_once __DIR__.'/../../../larco/bootstrap/app.php';


bootstrap/app.php file,

realpath(__DIR__.'/../../larco/')


bootstrap/autoload.php,

require __DIR__.'/../../larco/vendor/autoload.php';
$compiledPath = __DIR__.'/../../larco/cache/compiled.php';


My laravel version is laravel 5.2. And after I loaded 'http://domain.com/laravel/public/' link I get 'Whoops, looks like something went wrong.' issue. It would be great help if someone can look into it.

This is the issue added in storage/logs/laravel.log


production.ERROR: exception 'RuntimeException' with message 'No
supported encrypter found. The cipher and / or key length are
invalid.' in
/home/silverdr/larco/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45


This is my env file...

APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:tcPLEQN5yC984pB8EVHsdR/hLNFtq0hBasH+LMFBO+M=
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mydb
DB_USERNAME=myuser
DB_PASSWORD=mypass

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

Answer

After ao many false attempts change Encryption Key cipher to MCRYPT_RIJNDAEL_128 worked for me.

I changed in config/app.php,

'key' => env('APP_KEY'),

'cipher' => MCRYPT_RIJNDAEL_128,
  • MCRYPT_RIJNDAEL_128 Should be without quotes.