客户的一个项目,部署在阿里云,他们没有详细的需求,so,全程yum安装配置,记录一下。

需求:

centos 6.8 x64+nginx+php5.6+mysql5.7+redis+phpredis

实现:

PHP

yum list installed | grep php
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install -y php56w-fpm php56w-opcache php56w-cli php56w-common php56w-devel php56w-gd 
php56w-mbstring php56w-mcrypt php56w-mysqlnd php56w-pdo php56w-pear php56w-process php56w-xml 
php56w-xmlrpc

php -v
PHP 5.6.30 (cli) (built: Jan 19 2017 22:50:24)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Nginx

vim /etc/yum.repos.d/nginx.repo

[nginx] name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1

yum install nginx
nginx -v
nginx version: nginx/1.10.3```

MySQL

mysql -V
mysql  Ver 14.14 Distrib 5.7.17, for Linux (x86_64) using  EditLine wrapper

Redis:

cd /usr/local/
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
tar xzf redis-3.2.8.tar.gz
cd redis-3.2.8
make
cp utils/redis_init_script /etc/rc.d/init.d/redis #复制启动脚本并改名
vim /etc/rc.d/init.d/redis
mkdir /etc/redis
cp redis.conf /etc/redis/6379.conf
chkconfig --add redis
service redis start

PHPRedis

https://github.com/phpredis/phpredis

cd phpredis-develop
phpize
whereis php-config
php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz
./configure --with-php-config=/usr/bin/php-config```