ubuntu 编译php5.6,Ubuntu 16.04 源码编译 PHP5.6

源码编译PHP5.6

//更新依赖

sudo apt-get update

sudo apt-get install build-essential

//安装依赖

sudo apt-get install -y autoconf libtool re2c libxml2-dev openssl libcurl4-openssl-dev libbz2-dev libjpeg-dev libpng12-dev libfreetype6-dev libldap2-dev libmcrypt-dev libmysqlclient-dev libxslt1-dev libxt-dev libpcre3-dev libxpm-dev libt1-dev libgmp-dev libpspell-dev librecode-dev libreadline6-dev bison libtidy-dev libxpm-dev libssl-dev libgmp-dev

//链接到合适的地方

sudo ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/

sudo ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/

sudo ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h

//下载PHP源码

wget -O php.tar.xz https://secure.php.net/get/php-5.6.32.tar.xz/from/this/mirror

//解压源码

tar -Jxf /usr/src/php.tar.xz -C /usr/src/php --strip-components=1

//更新依赖

sudo apt-get update

sudo apt-get install build-essential

//安装依赖

sudo apt-get install -y autoconf libtool re2c libxml2-dev openssl libcurl4-openssl-dev libbz2-dev libjpeg-dev libpng12-dev libfreetype6-dev libldap2-dev libmcrypt-dev libmysqlclient-dev libxslt1-dev libxt-dev libpcre3-dev libxpm-dev libt1-dev libgmp-dev libpspell-dev librecode-dev libreadline6-dev bison libtidy-dev libxpm-dev libssl-dev libgmp-dev libpspell-dev libsnmp-dev

//链接到合适的地方

sudo ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/

sudo ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/

sudo ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h

//configure

sudo ./buildconf

sudo ./configure \

--prefix=/usr/local/etc/php \

--includedir=/usr/include \

--enable-opcache \

--enable-ctype \

--enable-fpm \

--enable-tokenizer \

--enable-fileinfo \

--enable-pdo \

--enable-sockets \

--enable-exif \

--enable-soap \

--enable-ftp \

--enable-wddx \

--enable-pcntl \

--enable-soap \

--enable-bcmath \

--enable-mbstring \

--enable-dba \

--enable-gd-native-ttf \

--enable-gd-jis-conv \

--enable-zip \

--enable-calendar \

--enable-shmop \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--with-mysqli \

--with-pdo-mysql \

--with-pdo-sqlite \

--with-iconv \

--with-gmp \

--with-pspell \

--with-gettext \

--with-xmlrpc \

--with-openssl \

--with-mhash \

--with-mcrypt \

--with-xsl \

--with-curl \

--with-pcre-regex \

--with-gd \

--with-jpeg-dir=/usr \

--with-png-dir=/usr \

--with-zlib-dir=/usr \

--with-xpm-dir=/usr \

--with-freetype-dir=/usr \

--with-gettext=/usr \

--with-zlib=/usr \

--with-bz2=/usr \

--with-recode=/usr \

--with-ldap \

--with-pear \

--with-readline \

--with-config-file-path=/usr/local/etc/php \

--with-config-file-scan-dir=/usr/local/etc/php/conf.d

//生成和安装

make

sudo make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值