1,在PHP的安装目录下的bin目录执行命令
./php -i|grep "configure"
找到PHP的configure文件,并返回到configure文件的父级目录,一般来说都是php的源码包解压文件夹。
2,执行
./configure --prefix=/server/php7
--with-config-file-path=/data/conf/php7
--sysconfdir=/data/conf/php7
--enable-fpm
--with-fpm-user=www
--with-fpm-group=www
--with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd
--with-iconv-dir
--with-freetype
--with-jpeg
--with-zlib-dir
--with-libxml
--enable-xml
--disable-rpath
--enable-bcmath
--enable-shmop
--enable-sysvsem
--enable-inline-optimization
--with-curl
--enable-mbregex
--enable-mbstring
--enable-ftp
--enable-gd
--with-mhash
--enable-pcntl
--enable-sockets
--with-xmlrpc
--enable-soap
--with-gettext
--disable-fileinfo --enable-opcache
--with-openssl
3,
make&&make install
附:迁移php7.4时的编译参数说明
参考博文:php重新编译