Php部署

Php编译安装

安装依赖包

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel

安装

tar -xf php-7.2.28.tar.gz

cd php-7.2.28

./configure --prefix=/application/php --disable-fileinfo --enable-fpm --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-apxs2=/application/apache-2.4.41/bin/apxs --with-openssl --with-zlib --with-curl --enable-ftp --with-gd --with-xmlrpc --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-mbstring --enable-zip --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --without-pear --enable-bcmath 

make && make install

配置文件

cp php-7.2.28/php.ini-production /etc/php.ini

cp /application/php/etc/php-fpm.conf.default   /application/php/etc/php-fpm.conf

php-fpm.conf 添加 include=/application/php/etc/php-fpm.d/*.conf

cp /application/php/etc/php-fpm.d/www.conf.default   /application/php/etc/php-fpm.d/www.conf

修改启动用户

user = www
group = www

检查配置文件

/application/php/sbin/php-fpm -t

启动

/application/php/sbin/php-fpm

重启kill 

php

相关推荐