centos 7 php fpm 5.3,ThinkPHP5 php_fpm nginx in CentOS7.3

install php7.1.13

把PHP安装到 /opt/php7.1.13/

from source

./configure

--enable-shared

--enable-mysqlnd

--disable-rpath

--disable-short-tags

--enable-bcmath

--enable-calendar

--enable-exif

--enable-fileinfo

--enable-fpm

--enable-ftp

--enable-gd-native-ttf

--enable-inline-optimization

--enable-maintainer-zts

--enable-mbregex

--enable-mbstring

--enable-opcache

--enable-pcntl

--enable-shmop

--enable-soap

--enable-sockets

--enable-sysvsem

--enable-sysvshm

--enable-xml

--enable-zip

--enable-phpdbg

--prefix=/opt/php7.1.12

--with-bz2

--with-curl

--with-fpm-group=www-data

--with-fpm-user=www-data

--with-freetype-dir

--with-gd

--with-gettext

--with-imap

--with-imap-ssl

--with-jpeg-dir=/usr

--with-kerberos

--with-libdir=/lib64

--with-libxml-dir=/usr

--with-mcrypt

--with-mhash

--with-mysql-sock=/var/lib/mysql/mysql.sock

--with-mysqli

--with-openssl

--with-pcre-regex

--with-pdo-mysql

--with-png-dir=/usr

--with-webp-dir=/usr/include/webp

--with-xmlrpc

--with-xsl

--with-zlib

--with-zlib-dir

make

sudo make install

# add php-fpm to service

# in the configure folder

sudo cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

sudo chmod o+x /etc/init.d/php-fpm

sudo chkconfig --add php-fpm

中间有很多依赖包需要安装,我说的许多是很多很多,具体哪些包我下次有新服务器的时候在补充。

config php-fpm

# enable conf file

ls /opt/php7.1.13/etc/php-fpm.conf.default

cp $_ ${_//.default/}

# enable pool conf file

ls /opt/php7.1.13/etc/php-fpm.d/www.conf.default

cp $_ ${_//.default/}

# edit conf file

vim $_

编辑 /opt/php7.1.13/etc/php-fpm.d/www.conf, daemon必须是系统中存在的用户,其他用户也可以,主要是listen的配置,路径可以指定其他的路径

查看daemon存在与否,cat一下/etc/passwd,grep下看见存在不。

user = daemon

group = daemon

# 使用unix socket方式,另外一种也可以啦,但我用这种方式

listen = /dev/shm/php-fpm.sock

# 是ae,不要打成ea

listen.owner = daemon

listen.group = daemon

# 服务器腾讯云2G2核的,2048可以的,你可以写大一点(成倍的),如果配置更高的话。

pm = dynamic

pm.max_requests = 2048

install nginx1.13.8

from source

./configure --prefix=/opt/nginx1.13.8 --sbin-path=/opt/nginx1.13.8/nginx --conf-path=/opt/nginx1.13.8/nginx.conf --pid-path=/dev/nginx/nginx.pid --with-http_ssl_module --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre --with-cc-opt="-Wno-deprecated-declarations"

make

sudo make install

配置

配置的thinkphp5

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值