部署php服务
安装部署php节点
(1)安装配置基础服务
解压软件包,编译并安装
[root@php ~]# yum -y install gcc gcc-c++ libxml2-devel libcurl-devel openssl-devel bzip2-devel
[root@php src]# tar -zxvf libmcrypt-2.5.8.tar.gz
[root@php src]# cd libmcrypt-2.5.8/
[root@php libmcrypt-2.5.8]# ./configure --prefix=/usr/local/libmcrypt && make && make install
(2)安装PHP环境
解压软件包,编译并安装php服务
[root@php src]# tar -zxvf php-5.6.27.tar.gz
[root@php src]# cd php-5.6.27/
[root@php php-5.6.27]# ./configure --prefix=/usr/local/php5.6 --with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --enable-fpm \
--enable-sockets --enable-sysvshm --enable-mbstring --with-freetype-dir --with-jpeg-dir \
--with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --with-mhash \
--with-mcrypt=/usr/local/libmcrypt --with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts
[root@php php-5.6.27]# make && make install
(3)配置PHP环境
对PHP环境需要用到的模板文件进行复制文件并改名
赋予文件权限,并添加php服务到启动列表,设置为开机启动
修改主配置文件php-fpm.conf
[root@php php-5.6.27]# cp /usr/local/php5.6/etc/php-fpm.conf.default /usr/local/php5.6/etc/php-fpm.conf
[root@php php-5.6.27]# vi /usr/local/php5.6/etc/php-fpm.conf
[root@php ~]# grep -n '^'[a-Z] /usr/local/php5.6/etc/php-fpm.conf
25:pid = run/php-fpm.pid
149:user = nginx
150:group = nginx
164:listen = 172.16.51.25:9000
224:pm = dynamic
235:pm.max_children = 50
240:pm.start_servers = 5
245:pm.min_spare_servers = 5
250:pm.max_spare_servers = 35
启动php服务(9000端口启动)