wget https://www.php.net/distributions/php-7.4.30.tar.gz
tar -zxvf php-7.4.30.tar.gz
yum -y install oniguruma-devel
yum groupinstall 'Development Tools' -y
cd php-7.4.30/
./configure --prefix=/usr/local/php74 --with-config-file-path=/usr/local/php74/etc --with-curl --with-freetype-dir --with-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-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --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
cp /php-7.4.30/php.ini-production /usr/local/php74/etc/php.ini
cp /usr/local/php74/etc/php-fpm.conf.default /usr/local/php74/etc/php-fpm.conf
cp /usr/local/php74/etc/php-fpm.d/www.conf.default /usr/local/php74/etc/php-fpm.d/www.conf
cd /
cd php-7.4.30/
cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm
chmod +x /etc/init.d/php7-fpm
//启动命令
service php7-fpm start
centos7源码编译php7.4
最新推荐文章于 2024-06-13 22:01:56 发布