0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Amazon Linux 2 で Laravel用の初期セットアップを行う(Nginx, PHP, MySQL, Composer)

Last updated at Posted at 2020-10-08

shellを作成する

vim setup.sh

以下のコードを貼り付ける

#!/bin/bash
sudo yum update -y

# nginx
sudo amazon-linux-extras install nginx1.12 -y
sudo systemctl start nginx
sudo systemctl enable nginx

# php
sudo amazon-linux-extras install php7.3 -y
sudo yum install php-xml php-mbstring -y

# mysql
sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm -y
sudo yum install mysql-community-server -y
sudo systemctl start mysqld.service
sudo systemctl enable mysqld.service

# composer
sudo curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

実行権限を与える

chmod +x setup.sh

shellを実行する

sudo ./setup.sh

nginxの設定変更

sudo vim /etc/php-fpm.d/www.conf
user = nginx # apache > nginxに変更
group = nginx # 同上

copy

sudo yum update -y
sudo amazon-linux-extras install nginx1.12 -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo amazon-linux-extras install php7.3 -y
sudo yum install php-xml php-mbstring -y
sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm -y
sudo yum install mysql-community-server -y
sudo systemctl start mysqld.service
sudo systemctl enable mysqld.service
sudo curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?