在linux上面編譯安裝php原本並不複雜,可是一般因爲不一樣發行版的軟件庫不一樣一般要安裝不一樣依賴,記錄一下這個版本的安裝,這樣之後會更方便一些。php
1.下載軟件mysql
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.安裝依賴linux
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.執行編譯sql
./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.安裝curl
sudo make make install