编译安装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. Linux计划任务.md

    crond crond是linux下用来周期性的执行某种任务或等待处理某些事件的一个守护进程,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动crond进程 ...

  2. Linux程序包管理.md

    rpm 简介 RPM包管理员(简称RPM,全称为The RPM Package Manager)是在Linux下广泛使用的软件包管理器.RPM此名词可能是指.rpm的文件格式的软件包,也可能是指其本身 ...

  3. [LeetCode] House Robber 打家劫舍

    You are a professional robber planning to rob houses along a street. Each house has a certain amount ...

  4. [LeetCode] Merge Intervals 合并区间

    Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8, ...

  5. VS调试经常打断点打上之后没反应的问题

    在调试的时候经常会发现打了断点但是始终不进到程序中来,这是因为访问的这个页面在服务器中有缓存,也就是在iis中产生了缓存.访问的时候直接进到读取的缓存文件, 根本没有读取项目文件,所以打了断点肯定进不 ...

  6. 【MySQL】mysql 1449 : The user specified as a definer ('root'@'%') does not exist

    权限问题,授权 给 root  所有sql 权限 1.mysql> grant all privileges on *.* to root@"%" identified by ...

  7. CentOS升级openssl

    才设置了http2,结果蓝狗说我网站不安全,检测一下发现openssl有漏洞,于是准备升级一下openssl 检测网站: www.ssllabs.com/ssltest/analyze.html # ...

  8. 在 Sublime Text 3 中配置编译和运行 Java 程序

    参考网址:http://www.open-open.com/lib/view/open1388105023765.html 1. 设置 java 的 PATH 环境变量 2. 创建批处理或 Shell ...

  9. linux-crontab定时任务

    crontab命令常见于Unix和Linux的操作系统之中,用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于"crontab"文件中,以供之后读取和执行.通常 ...

  10. C#-WebForm-点击网页中的按钮后跳转到其他页面是怎么实现的?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...