Ubuntu 20.04编译安装PHP 7.4.10

 

安装PHP所需要的软件依赖:

sudo apt-get install -y libxml2-dev build-essential openssl  libssl-dev libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev libreadline6-dev libsqlite3-dev libzip-dev libonig-dev

下载安装:

wget https://www.php.net/distributions/php-7.4.8.tar.gz

解压:

tar -zxvf php-7.4.8.tar.gz

安装PHP 到 /usr/local/php/

mkdir /usr/local/php/

./configure –prefix=/usr/local/php –enable-fpm –with-zip –with-mysqli –enable-gd –with-zlib –with-curl –enable-mbstring –enable-bcmath –disable-ctype –with-openssl –enable-tokenizer –enable-sockets

make

sudo make install

启动php-fpm

sudo /usr/local/php/sbin/php-fpm

 

 

 

 

 

分类: LinuxPHP