基于centos的部署
有很多软件位于 EPEL 仓库中, 而默认情况下安装的 CentOS 中没有该仓库, 因此需要自己手动添加.
yum -y install epel-release
php7-fpm 依赖需要
rpm -Uvh <https://mirror.webtatic.com/yum/el7/webtatic-release.rpm>
yum -y install php70w-fpm php70w-cli php70w-gd php70w-mcrypt php70w-mysql php70w-pear php70w-xml php70w-mbstring php70w-pdo php70w-json php70w-pecl-apcu php70w-pecl-apcu-devel
安装之后可以使用php -v检查版本
PHP 7.0.32 (cli) (built: Sep 15 2018 07:54:46) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologie
以下使用 nginx 用户运行:
vim /etc/php-fpm.d/www.conf
修改使用者和组成员为nginx
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
检查监听端口
; Note: This value is mandatory.
listen = 127.0.0.1:9000
把环境变量添加,去掉注释分号