在linux上面编译安装php本来并不复杂,但是通常由于不同发行版的软件库不同通常要安装不同依赖,记录一下这个版本的安装,这样以后会更方便一些。
1.下载软件
wget https://www.php.net/distributions/php-7.3.5.tar.gz
tar xzf php-7.3.5.tar.gz
cd php-7.3.5
2.安装依赖
sudo apt install -y gcc make openssl curl libbz2-dev libxml2-dev libjpeg-dev libpng-dev libfreetype6-dev libzip-dev libcurl4-gnutls-dev libssl-dev
3.执行编译
./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=bandit --with-fpm-group=bandit --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
4.安装
sudo make
make install