##########################################################################################################
# 5. 安装Nginx
yum install -y nginx
提示：出现No package nginx available错误，先安装yum install epel-release 再yum install -y nginx
systemctl enable nginx

vim /etc/nginx/nginx.conf

添加http节点：
    include /data/nginx/conf.d/*.conf;

mkdir -p /data/nginx/conf.d
systemctl start nginx

# 6. 安装PHP7.2
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install php72w

# 7. 安装php扩展
yum install php72w-common php72w-fpm php72w-opcache php72w-gd php72w-mysqlnd php72w-mbstring php72w-pecl-redis php72w-pecl-memcached php72w-devel php72w-bcmath php72w-intl

# 8. 配置用户和用户组

修改user和group为www
groupadd www
adduser -g www www
vim /etc/php-fpm.d/www.conf

group 和 user 均为 www
# 9. 设置开机启动
systemctl enable php-fpm
systemctl start php-fpm
# 10. 配置项目目录
mkdir -p /data/www
mkdir -p /data/logs

# 11. 安装composer
cd /home
curl -sS https://getcomposer.org/installer | php
php composer.phar
mv composer.phar /usr/local/bin/composer
chmod 744 /usr/local/bin/composer
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

##########################################################################################################

安装mcrypt扩展

cd /data

yum -y install libmcrypt libmcrypt-devel mcrypt mhash

wget  http://pecl.php.net/get/mcrypt-1.0.1.tgz

tar xf mcrypt-1.0.1.tgz

cd mcrypt-1.0.1

phpize

./configure --with-php-config=/usr/bin/php-config

make && make install

-------------------------------------------------

配置mcrypt扩展

cd /etc/php.d
cp bcmath.ini mcrypt.ini
vi mcrypt.ini

改so文件

systemctl stop php-fpm
systemctl start php-fpm

php -m | grep mcrypt