DL Laravel environment construction method (Linux)

[Prerequisites] The Lamp environment with composer installed has been built normally.

You can run the Laravel project downloaded from github for the time being Set up to use.

1. DL the laravel project

Let's access GitHub and download a suitable Laravel project for the time being [project name testlaravel] laravel1.png

2. Install composer

I get an error like this when I try to launch serve for a DL testlaravel project.

/var/www/html/testlaravel$ php artisan serve
I get this error ↓
PHP Warning:  require(/var/www/html/testlaravel/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/testlaravel/artisan on line 18

Warning: require(/var/www/html/testlaravel/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/testlaravel/artisan on line 18
PHP Fatal error:  require(): Failed opening required '/var/www/html/testlaravel/vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/testlaravel/artisan on line 18

Fatal error: require(): Failed opening required '/var/www/html/testlaravel/vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/testlaravel/artisan on line 18

Install composer because the Laravel project cannot be started because Composer is not included.

/var/www/html/testlaravel# composer install

3. When the composer installation is complete

Let's launch the testlaravel project as soon as the composer installation is complete

 /var/www/html/testlaravel# php artisan serve

It does get up, but I always get a 500 server error here. 500serve.png

4. Set the .env file and APP_KEY

The .env file is not created in laravel as a cause of the error here A server error has occurred due to the fact that APP_key has not been created.

First, let's create an .env file. Enter the following in the command

cp .env.example .env

At this stage, the env file has not been created yet, so let's create APP_KEY.

php artisan key:generate

Enter vi .env and if the .env file is created successfully, you are done. ↓ This is the guy

APP_NAME=
APP_ENV=
APP_KEY=
APP_DEBUG=
APP_URL=

LOG_CHANNEL=

DB_CONNECTION=
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
(Omitted below)

If you launch the testalaravel project again and the usual page appears, it is a success. thelaravel.png

Recommended Posts

DL Laravel environment construction method (Linux)
Linux environment construction
Deployment method (2) (EC2 environment construction / Linux / MySQL settings)
About Linux environment construction (CentOS)
First LAMP environment construction (Linux)
Linux environment construction (on WSL environment)
About Linux environment construction (VMware VirtualBOX)
[Linux] Docker environment construction on Redhat
Django environment construction
DeepIE3D environment construction
Emacs-based environment construction
Python environment construction
Linux (CentOS) construction
Environment construction (python)
django environment construction
CodeIgniter environment construction
python environment construction
Python --Environment construction
Python environment construction
Golang environment construction
python environment construction
Word2vec environment construction
Environment construction: GCP + Docker
Django project environment construction
python windows environment construction
Go language environment construction
ConoHa environment construction memo
homebrew python environment construction
PyData related environment construction
Anaconda-4.2.0-python3 environment construction (Mac)
Python development environment construction
[Linux] WSL2 Build an environment for laravel7 with Ubuntu 20.04
YOLO v4 environment construction ①
Linux PATH environment variable
pyenv + fish environment construction
python2.7 development environment construction
BigGorilla environment construction memo
grip environment construction onCentOS6.5
Anaconda environment construction memo
Golang environment construction [goenv]
Mac environment construction Python
Pyxel environment construction (Mac)
Python environment construction @ Win7
Memo of Linux environment construction using VirtualBox + Vagrant on Windows 10
[Ubuntu 18.04] Tensorflow 2.0.0-GPU environment construction
Python + Anaconda + Pycharm environment construction
PyTorch C ++ (LibTorch) environment construction
Anaconda environment construction on CentOS7
Django development environment construction memo
SSH restrictions in Linux environment
What are environment variables? (Linux)
Python environment construction (Windows10 + Emacs)
CI environment construction ~ Python edition ~
[Memo] Construction of cygwin environment
ML environment construction with Miniconda
Python environment construction For Mac
Anaconda3 python environment construction procedure
Docker + Django + React environment construction
Anaconda3 × Pycharm environment construction memo
Python3 environment construction (for beginners)
Python environment construction and TensorFlow