Amazon linux2 php5.4.16 설치, php5.6.40 설치, apache, httpd
Amazon Linux AMI 2018 EOS로 php 기반 서버들의 OS udate가 요구됨
Amazon linux2 EC2 생성
apache 설치
sudo yum update -y
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl status httpd
php 5.4.16 설치
sudo amazon-linux-extras install epel -y
sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php56
sudo yum install -y php php-cli php-common php-devel php-mbstring php-xml php-mysqlnd
sudo systemctl restart httpd
php -v
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
http://hostaddress/info.php
sudo rm /var/www/html/info.php
php 5.4.16 > php 5.6.40 변경
sudo yum remove php php-cli php-common php-devel php-mbstring php-xml php-mysqlnd -y
sudo amazon-linux-extras install epel -y
sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo vi /etc/yum.repos.d/remi.repo
[remi]
name=Remi's RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/remi/$basearch/
mirrorlist=https://rpms.remirepo.net/enterprise/7/remi/mirror
enabled=1
priority=1
gpgcheck=1
gpgkey=https://rpms.remirepo.net/RPM-GPG-KEY-remi
[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/php56/$basearch/
mirrorlist=https://rpms.remirepo.net/enterprise/7/php56/mirror
enabled=1
priority=1
gpgcheck=1
gpgkey=https://rpms.remirepo.net/RPM-GPG-KEY-remi
remi와 remi-php56 항목에 priority=1 추가
sudo yum install -y php php-cli php-common php-devel php-mbstring php-xml php-mysqlnd
php -v
vi /etc/php.ini
short_open_tag = ON