本文主要和大家分享linux如何安裝php7.2,希望能協助到大家,首先下載php的源碼,命令如下
wget http://cn2.php.net/distributions/php-7.2.0.tar.gz
解壓縮
tar -zxvf php-7.2.0.tar.gz
進入檔案夾
然後執行如下命令,我指定的安裝目錄是/web/php72 ,必須保證目錄存在
./configure \--enable-fpm \--prefix=/web/php72 \--with-config-file-path=/web/php71/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-pdo-sqlite \ --with-pear \ --with-png-dir \--with-jpeg-dir\ --with-xmlrpc \ --with-xsl \ --with-zlib \ --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-xml \ --enable-zip