centos7编译安装php7.4

centos7编译安装php7.4

   小白     2020年9月30日 10:33     1758    

1、安装php7.4.10

解压

tar -zxvf php-7.4.10.tar.gz

cd php-7.4.10

./configure

--prefix=/usr/local/php

--with-config-file-path=/usr/local/php/etc

--with-mysqli=mysqlnd

--with-pdo-mysql=mysqlnd

--with-openssl

--with-gd

--with-gettext

--with-bz2

--with-iconv-dir

--with-zlib

--with-zlib-dir

--with-curl

--with-xmlrpc

--enable-fpm

--with-fpm-user=www

--with-fpm-group=www

--enable-pcntl

--enable-intl

--enable-sockets

--enable-gd-jis-conv

--enable-ftp

--enable-zip

--enable-calendar

--enable-mbstring

--enable-exif

--enable-soap

--enable-bcmath

--enable-fd-setsize=4096

--disable-short-tags

--disable-ipv6

 

make

make install

 

2、复制配置文件

cp /usr/local/software/php-7.4.10/php.ini-production /usr/local/php/etc/php.ini

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

 

cd /usr/local/ php

chown -R www:www var/run/

chown -R www:www var/log/

cp /usr/local/software/php-7.4.10/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

chmod +x /etc/init.d/php-fpm

chkconfig --add php-fpm

service php-fpm start

chkconfig php-fpm on

 

问题:

在安装zip扩展的时候可能会提示system libzip must be upgraded to version >= 0.11

wget https://nih.at/libzip/libzip-1.2.0.tar.gz

tar -zxvf libzip-1.2.0.tar.gz

cd libzip-1.2.0

./configure

make

make install

然后在/etc/profile中添加以下信息

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

source /etc/profile

 

如果缺少依赖可以查考文章

https://www.24kplus.com/linux/400.html

 

文章评论

0

其他文章