php56 centos7,centos7 编译php56

编译安装php5.6 centos7环境

步骤:

//下载php5.6

wget http://cn2.php.net/distributions/php-5.6.26.tar.bz2

//安装依赖

yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel httpd-devel

//解压

tar -jxvf php-5.6.26.tar.bz2

cd php-5.6.26

//编译

./configure --prefix=/usr/local/php --with-apxs2=/usr/bin/apxs --with-mysql=/usr/local/mysql --with-mysql-sock --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --with-ncurses --enable-soap --with-libxml-dir --with-XMLrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --disable-mbregex --disable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-pdo-mysql --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear

提示: configure: error: xml2-config not found. Please check your libxml2 installation.

yum install libxml2-dev

提示:Cannot find OpenSSL‘s

yum install openssl openssl-devel

提示:configure: error: Please reinstall the BZip2 distribution

yum install bzip2-devel

提示: configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/

yum install libcurl-devel

提示:If configure fails try --with-vpx-dir=

yum install libjpeg-devel

提示:configure: error: png.h not found.

yum install libpng-devel

提示:configure: error: freetype-config not found

yum install freetype-devel

提示:configure: error: Unable to locate gmp.h

yum install gmp-devel

提示:configure: error: mcrypt.h not found. Please reinstall libmcrypt.,由于版权的原因没有自带mcrypt的包。额外安装

wget http://www.atomicorp.com/installers/atomic

chmod 777 atomic

./atomic

yum install php-mcrypt libmcrypt libmcrypt-devel

提示:configure: error: Cannot find MySQL header files under /usr/local/mysql.

Note that the MySQL client library is not bundled anymore!

yum install mysql-devel

然后修改为mysqlnd

--with-mysql=mysqlnd --with-mysqli=mysqlnd

Mysql Native驱动(Mysql Native Driver 简称:mysqlnd )在PHP5.3.0版本中被引入。PHP5.4之后的版本mysqlnd被作为默认配置选项

ee89bee9105a9530c5d969b3c56713e8.png

修改过后的安装依赖:

yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel httpd-devel libxml2-dev openssl openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel gmp-devel

mycrypt

wget http://www.atomicorp.com/installers/atomic

chmod 777 atomic

./atomic

yum install php-mcrypt libmcrypt libmcrypt-devel

编译选项:

./configure --prefix=/usr/local/php --with-apxs2=/usr/bin/apxs --with-mysql=mysqlnd --with-mysql-sock --with-mysqli=mysqlnd --enable-fpm --with-ncurses --enable-soap --with-libxml-dir --with-XMLrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --disable-mbregex --disable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-pdo-mysql --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear

原文:http://www.cnblogs.com/yangxunwu1992/p/5898416.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值