Contents

编译安装php-fpm

Contents

编译安装php-fpm

使用编译安装php的方法 首先安装php相关依赖 yum -y install libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel libicu-devel freetype-devel openldap-devel openldap openldap-devel yum -y install gcc gcc-c++ make sqlite-devel.x86_64 oniguruma-devel.x86_64 libxslt-devel.x86_64 libzip-devel.x86_64 下载php本体(官方链接) #以7.4.28版本为例 wget https://www.php.net/distributions/php-7.4.28.tar.gz 进入文件夹 cd php-7.4.28 运行脚本 ./configure
–prefix=/usr/local/php
–with-config-file-path=/usr/local/php/etc
–with-fpm-user=www
–with-fpm-group=www
–with-curl
–with-MySQL=/usr/local/mysql
–with-freetype-dir=/usr/local/freetype
–enable-gd
–with-gettext
–with-iconv-dir
–with-kerberos
–with-libdir=lib64
–with-libxml-dir
–with-mysqli
–with-openssl
–with-pcre-regex
–with-pdo-mysql
–with-pdo-sqlite
–with-pear
–with-png-dir=/usr/local/libpng
–with-jpeg-dir=/usr/local/libjpeg
–with-xmlrpc
–with-xsl
–with-zlib
–with-zlib-dir=/usr/local/zlib
–with-bz2
–with-mhash
–with-zip
–enable-fpm
–enable-bcmath
–enable-libxml
–enable-inline-optimization
–enable-mbregex
–enable-mbstring
–enable-opcache
–enable-pcntl
–enable-shmop
–enable-soap
–enable-sockets
–enable-sysvsem
–enable-sysvshm
–enable-xml
–enable-zip
–enable-fpm

编译并安装 make && make install 将配置文件做一个软连接到etc下 ln -s /usr/local/php/etc/php.ini /etc/php.ini