Failed to add laravel 5 project to subfolder

I added my laravel 5 project to a 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 the 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 version of laravel is laravel 5.2. And after I downloaded the link http://domain.com/laravel/public/ , I get "Oops, something seems to have gone wrong." question. It would be very helpful if someone could study this.

This is a problem added to storage / logs / laravel.log

production.ERROR: "RuntimeException" " encrypter. / .' /home/silverdr/larco/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45

env...

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
+4
3

, MCRYPT_RIJNDAEL_128, .

config/app.php,

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

'cipher' => MCRYPT_RIJNDAEL_128,
  • MCRYPT_RIJNDAEL_128 .
+1

.

  • server.php index.php.
  • .htaccess ( )
  • .htaccess RewriteEngine On RewriteBase/yoursubfolder/

laravel - 5.2, . , , .

+1

, , , Laravel . , .

Laravel :

  • public_html
  • mysqld ( cPanel)
  • Next, import the local database .sqlfrom local phpmyadmin into phpmyadmin online hosting
  • The next step is to go to the project folder and edit the next one in the .envfile

DB_DATABASE=yourdatabasename

DB_USERNAME=databaseusername

DB_PASSWORD=databasepassword

and now your project will live, yoursite.com/yourproject

Here is the video in which I deployed my application in a subdirectory: Tutorial

0
source

Source: https://habr.com/ru/post/1649352/


All Articles