text CentOS 7,nginx,PHP 7.1配置
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text CentOS 7,nginx,PHP 7.1配置相关的知识,希望对你有一定的参考价值。
Step by step installation guide for nginx + PHP 7.1 on CentOS 7
1. Add and enable Remi repos
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils
yum-config-manager --enable remi-php71
2. Install php 7.1 and required modules
yum install php71-php-fpm
php71-php-mysqlnd
php71-php-mcrypt
php71-php-mbstring
php71-php-pecl-memcached
php71-php-pecl-apcu
php71-php-gd php71-php-imap
php71-php-ldap
php71-php-odbc
php71-php-snmp
php71-php-soap
php71-php-tidy
php71-php-xmlrpc
php71-php-pecl-zip
php71-php-gd
php71-php-process
php71-php-intl
3. Change php-fpm configuration
a) Open: /etc/opt/remi/php71/php-fpm.d/www.conf
b) Change socket path.
Comment "listen = 127.0.0.1:9000"
and after that line insert:
"listen = /var/run/php71.sock"
c) Change Unix user/group of processes to nginx
user = nginx
group = nginx
d) Uncomment and change socket owner
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
4. Enable & start service
systemctl enable php71-php-fpm
systemctl start php71-php-fpm
5. Set php-fpm path socket in nginx config
fastcgi_pass unix:/var/run/php71-fpm.sock;
6. (Optional) Set php 7.1 as default on login
Create: /etc/profile.d/php.sh
source /opt/remi/php71/enable
export X_SCLS="`scl enable php71 'echo $X_SCLS'`"
===========================================================
Configuration:
/etc/opt/remi/php71/php-fpm.d/www.conf
/opt/remi/php56/root/etc/php-fpm.d/www.conf
Logs:
/var/opt/remi/php71/log/php-fpm/www-error.log
/var/opt/remi/php71/log/php-fpm/error.log
/opt/remi/php56/root/var/log/php-fpm/error.log
/var/log/nginx/access.log
/var/log/nginx/error.log
YUM repositories
/etc/yum.repos.d
yum repolist all
PHP 5.6
Install:
yum install php56-php-fpm php56-php-mysqlnd php56-php-mcrypt php56-php-mbstring php56-php-pecl-memcached php56-php-magickwand php56-php-pecl-apcu php56-php-gd php56-php-imap php56-php-ldap php56-php-odbc php56-php-snmp php56-php-soap php56-php-tidy php56-php-xmlrpc php56-php-gd php56-php-process php56-php-intl
systemctl enable php56-php-fpm.service
以上是关于text CentOS 7,nginx,PHP 7.1配置的主要内容,如果未能解决你的问题,请参考以下文章
centos 7.2 搭建php运行环境
如何在CentOS 7中使用Nginx和PHP7-FPM安装Nextcloud
如何在CentOS 7中使用Nginx和PHP7-FPM安装Nextcloud
centos7 Nginx1.14+php7+mysql5.7 以及 centos7 Apache2.4+PHP7+mysql 安装 Linux 配置 composer 以及Python2.7升级到
CentOS 7 安装PHP7+Nginx+Mysql5.7开发环境
CentOS 7 安装 WordPress,PHP,Nginx,MySQL(MariaDB)