python
$ sudo apt-get update
$ sudo apt -y install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
You can now use apt with a repository where you can install PHP 7.4.
python
$ sudo apt install php7.4 php7.4-mbstring php7.4-dom
Install other necessary items as well.
python
$ php -v
PHP 7.4.12 (cli) (built: Oct 31 2020 17:04:09) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies
If this happens, it's OK!
In order to install Laravel, you also need to install Composer. Composer is PHP's package management tool, and it seems that you can manage packages efficiently by using Composer.
python
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Use the command on the official website (https://getcomposer.org/download/)
python
$ ./composer.phar -V
Composer version 1.10.1 2020-03-13 20:34:27
This is OK
python
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo chmod +x /usr/local/bin/composer
$ composer -v
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 2.0.7 2020-11-13 17:31:06
Omitted below.
python
$ sudo apt install -y zip unzip
Install the zip command because the unzip command is required when installing Laravel.
python
$composer create-project --prefer-dist laravel/laravel="6.*" laravel6
When you execute the following, a folder called laravel6 will be created under the execution folder, and the files required for Laravel will be saved in that folder.
You can use any name you like for laravel6
python
$ cd laravel6
$ php artisan serve
http://127.0.0.1:8000/ If you access this screen and this screen appears, it's OK!
Recommended Posts