安装php7

在安装php7的过程中的备忘录

环境

操作系统:CentOS 6.8

操作步骤

$ sudo yum -y install epel-release
$ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

# こっちでも可能
# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# sudo rpm -Uvh remi-release-6*.rpm

$ sudo yum -y install  --enablerepo=remi --enablerepo=remi-php70 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-fpm php-intl php-pdo php-gd

※ 我选择提取似乎是必需的模块。

$ php -v
PHP 7.0.9 (cli) (built: Jul 20 2016 18:08:08) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.9, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans

安装php-fpm

$ sudo yum -y install  --enablerepo=remi --enablerepo=remi-php70 php-fpm

# www.confを編集
$ sudo emacs /etc/php-fpm.d/www.conf
user = nginx
group = nginx
listen = /var/run/php-fpm/php-fpm.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660

# 自動起動設定
$ sudo chkconfig php-fpm on


只需要安装MySQL客户端,如果DB服务器是独立的。

$ sudo yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
$ sudo yum install mysql-community-client
广告
将在 10 秒后关闭
bannerAds