ubuntu16.04下源码编译安装PHP7 过程记录
下载PHP7的最新版源码
http://php.net/get/php-7.0.9.tar.gz/from/a/mirror
解压
进入你下载的目录
tar -zxvf php-7.0.9.tar.gz
安装相关依赖
sudo apt-get update
sudo apt-get install libxml2-dev
sudo apt-get install build-essential
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install make
sudo apt-get install curl
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libmcrypt-dev
sudo apt-get install libreadline6 libreadline6-dev
编译
进人解压后的目录
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-intl --enable-mbregex --enable-mbstring --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-dba --enable-zip --with-freetype-dir --with-gd --with-gettext --with-iconv --with-icu-dir=/usr --with-jpeg-dir --with-kerberos --with-libedit --with-mhash --with-openssl --with-png-dir --with-xmlrpc --with-zlib --with-zlib-dir --with-bz2 --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-gmp --with-curl --with-xsl --with-ldap --with-ldap-sasl=/usr --enable-pcntl --with-tidy --enable-zend-signals --enable-dtrace --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-pdo --enable-opcache --with-mcrypt --enable-maintainer-zts --enable-gd-jis-conv --with-imap --with-imap-ssl --with-libxml-dir --enable-shared --with-pcre-regex --with-sqlite3 --with-cdb --enable-fileinfo --enable-filter --with-pcre-dir --with-openssl-dir --enable-json --enable-mbregex-backtrack --with-onig --with-pdo-sqlite --with-readline --enable-session --enable-simplexml --enable-mysqlnd-compression-support --with-pear
执行make 和 sudo make install 安装
配置php-fpm
验证PHP
启动php-fpm
领取专属 10元无门槛券
私享最新 技术干货