Amazon EC2 (RHEL 7.5 AMI)に PHP 7.2 + Laravel 5.5 + MySQL 5.7 をインストールする手順 (201805版)



Amazon EC2 (RHEL 7.5)に PHP 7 + Laravel 5.5 + Apache 2.4 + MySQL をインストールする


PHP 7.2

#    Turn on EPEL repo, enter:
sudo yum -y install epel-release
#   Turn on Remi repo i.e.remi-php72:
sudo yum-config-manager --enable remi-php72
#   Refresh repository:
sudo yum update
#   Install php version 7.2, run:
sudo yum install php


sudo yum install git


sudo curl -sS | php
sudo mv composer.phar /usr/local/bin/composer
sudo chown root:root /usr/local/bin/composer
ll /usr/local/bin/composer

※Macの場合は sudo chown root:wheel /usr/local/bin/composer


yum localinstall
sudo yum info mysql-community-server
sudo yum -y install mysql-community-server
mysqld --version
# Start MYSQL
sudo systemctl enable mysqld.service
#sudo service mysqld start
sudo systemctl start mysqld.service

grep "A temporary password is generated" /var/log/mysqld.log
sudo mysql_secure_installation
CREATE USER your_user IDENTIFIED BY 'your_password';

drop database your_database;
create database your_database character set utf8;
show create database your_database;
GRANT ALL PRIVILEGES ON your_database.* TO your_user@localhost IDENTIFIED BY 'your_password';
flush privileges;

select Host, User, Password  from mysql.user;

mysql -u your_user -p


mysql -uuseraaaa -p

PHP - MySQL Library install

sudo yum list available | grep php72
sudo yum install -y php-mysqlnd
sudo yum install -y php-mbstring php-xml
sudo yum list installed | grep php
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.