编译安装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=mysqlnd --with-mysql-sock --with-mysqli=mysqlnd --enable-fpm  --enable-soap --with-libxml-dir --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-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx   --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 <evp.h>

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 <curl-dir>/include/curl/

yum install libcurl-devel

提示:If configure fails try --with-vpx-dir=<DIR> configure: error: jpeglib.h not found

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被作为默认配置选项

修改过后的安装依赖:
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  --enable-soap --with-libxml-dir --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-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx   --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear

  

httpd.conf添加libphp5.so

LoadModule php5_module   /usr/lib64/httpd/modules/libphp5.so

和mime添加

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

  

centos7 编译php56的更多相关文章

  1. CentOS7编译安装Nginx-1.8.1和编译参数

    CentOS7编译安装Nginx-1.8.1和编译参数 Web服务器Nginx    LNMP是一组众所周知的Web网站服务器架构环境,即由Linux+Nginx+MySQL+PHP(MySQL有时也 ...

  2. centos7编译安装MySQL5.7.9

    title: centos7编译安装MySQL5.7.9 date: 2016-05-12 16:20:17 tags: --- Centos7编译安装mysql5.7.9 mysql5.7有更好的性 ...

  3. Centos7编译opencv3.4.1

    Centos7编译opencv3.4.1 参考博客 https://blog.csdn.net/wjbwjbwjbwjb/article/details/79111996 1.配置epel源 yum ...

  4. centos7 编译安装新版LNMP环境

    centos7 编译安装新版LNMP环境 环境版本如下: 1.系统环境:Centos 7 x86_64 2.NGINX:nginx-1.11.3.tar.gz 3.数据库:mariadb-10.0.2 ...

  5. CentOS7编译安装httpd-2.4.41 php7.3

    CentOS7编译安装httpd-2.4.41 php7.3 安装参考环境: CentOS Linux release 7.5.1804 (Core) 一.安装依赖包 httpd安装的依赖包 # yu ...

  6. centos7 编译问题:aclocal-1.14: command not found

    centos7 编译问题:aclocal-1.14: command not found https://blog.csdn.net/vr7jj/article/details/80438663

  7. Centos7 编译安装PHP7

    Centos7 编译安装PHP7 编译安装的方式可以让组件等设置更加合理,但需要你对PHP的代码及各种配置非常的熟悉,以下为大致的安装流程,大家可以参考 1.下载编译工具 yum groupinsta ...

  8. CentOS7编译和安装GCC7.5

    CentOS7编译和安装GCC7.5 一.    环境介绍: CentOS7 虚拟机连上了互联网(为什么要强调这点呢,因为CentOS7每次进入系统,都需要手动点击右上角的Connect,才能连上互联 ...

  9. CentOS7编译安装php7.1配置教程详解

    这篇文章主要介绍CentOS7编译安装php7.1的过程和配置详解,亲测 ,需要的朋友可以参考. 1.首先安装依赖包: yum install libxml2 libxml2-devel openss ...

随机推荐

  1. cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:annotation-driven'.

    spring 配置文件报错报错信息:cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be ...

  2. 使用串口线真机调试Linux内核

    一.环境 ubuntu 14.04 一台有串口的PC(编号PC1,被调试机器) 另一台PC通过USB转串口线连接PC1(编号PC2,发起调试命令的机器) 二.串口线配置及测试 安装cutecom US ...

  3. xml解析

    config.xml <?xml version="1.0" encoding="UTF-8"?> <prize> <gift&g ...

  4. [LeetCode] Longest Substring Without Repeating Characters 最长无重复子串

    Given a string, find the length of the longest substring without repeating characters. For example, ...

  5. 昆仑游戏[JS加密修改]

    昆仑游戏:http://www.kunlun.com/index.html JS加密修改 BigTools=window.BigTools;//重点 RSAKeyPair=window.RSAKeyP ...

  6. sql查询慢优化

    SELECT g.goods_id, g.type_id, g.user_id, g.productname, g.img, g.intro, g.attr, u.companyname, u.enl ...

  7. 给空签名包进行签名以及找不到keystore证书链问题的解决方案

    转 http://blog.csdn.net/u011106842/article/details/49683865

  8. phpcms二次开发中无法获取SESSION的值

    今天在在phpcms开发留言板用到验证码,提交数据,后台无法$_SESSION['code']无法获取验证码值,也无法打印var_dump($_SESSION)值,我们只需要在文件头部添加如下代码: ...

  9. 【bzoj1415】 Noi2005—聪聪和可可

    http://www.lydsy.com/JudgeOnline/problem.php?id=1415 (题目链接) 题意 一张图,聪聪想吃可可.每单位时间聪聪可以先移动两次:可可后移动一次或停在原 ...

  10. EventDispatcher 事件分发组件

    引言 考虑这样一个问题,现在你想给为你的项目提供一个插件系统,插件可以添加一些方法,或者在某些方法执行之前或者之后做些事情,而不干扰其他插件.要实现这个系统,简单的单继承不是个好办法,即使多继承在PH ...