一、安装PHP5

PHP官网www.php.net 当前主流版本为5.6/7.1

cd /usr/local/src/

wget http://cn2.php.net/distributions/php-5.6.30.tar.gz

tar zxvf php-5.6.30.tar.gz

cd php-5.6.30

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

报错

yum install -y libxml2-devel

yum install -y openssl openssl-devel

yum install -y bzip2 bzip2-devel

yum install -y libpng libpng-devel

yum install -y freetype freetype-devel

yum install -y epel-release

yum -y install libjpeg-devel

报错centos里面没有libmcrypt,只能下载

libmcrypt

libmcrypt  http://sourceforge.net/project/showfiles.php?group_id=87941&package_id=91774&release_id=487459   
mhash  http://sourceforge.net/project/showfiles.php?group_id=87941&package_id=91948&release_id=642101

mcrypt  :http://sourceforge.net/project/showfiles.php?group_id=4286&package_id=4300&release_id=645636

三者缺一不可

安装libmcrypt
#tar -zxvf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure
#make&&make install 说明:libmcript默认安装在/usr/local

安装mhash

#tar -zxvf mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9
#./configure
#make && make install

安装mcrypt

#tar -zxvf mcrypt-2.6.8.tar.gz
#cd mcrypt-2.6.8
#LD_LIBRARY_PATH=/usr/local/lib ./configure
#make && make install

最后安装

cd ..

cd php-5.6.30

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

安装完成

make && make install

cp php.ini-production /usr/local/php/etc/php.ini 配置文件路径

二、安装PHP7

cd /usr/local/src/

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

tar zxf php-7.1.6.tar.bz2 报错

tar jxvf php-7.1.6.tar.bz2

cd php-7.1.6

./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php7/etc --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

make && make install

ls /usr/local/apache2.4/modules/libphp7.so

cp php.ini-production /usr/local/php7/etc/php.ini

Linux CentOS7 VMware 安装PHP5 、安装PHP7的更多相关文章

  1. Linux CentOS7 VMware 安装软件包的三种方法、rpm包介绍、rpm工具用法、yum工具用法、yum搭建本地仓库

    一.安装软件包的三种方法 Linux下游三种安装方法,rpm工具.yum工具.源码包.rpm按装一个程序包时,有可能因为该程序包依赖另一个程序包而无法安装:yum工具,可以连同依赖的程序包一起安装. ...

  2. Linux CentOS7系统中php安装配置

    本篇讲解如何配置php开发环境,让你的php代码可以正常的在网页中运行. 准备工作 linux centos7操作系统 ssh软件 nginx php资源 想要了解更多关于php的内容,请访问: ph ...

  3. linux(centos7) nginx php mysql安装

    环境: linux:centos7 php:7.0 基础命令 // yum install -y lrzsz // centos7 默认已安装yum install epel-release ngin ...

  4. Linux CentOS7系统中phpMyAdmin安装配置

    今天介绍的是如何在Linux CentOS7系统中配置phpMyAdmin. 目录 环境准备 安装包 基本设置 网站预览 环境准备 linux centos7系统 ssh软件 php语言环境 mysq ...

  5. Linux CentOS7系统中mysql8安装配置

    mysql是世界上最流行的关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司所有.今天我将记录一下如何在Linux centos7系统上安装和配置MySQL. 目录 环境准 ...

  6. 安装PHP5和PHP7

    5月25日任务 课程内容: 11.10/11.11/11.12 安装PHP511.13 安装PHP7php中mysql,mysqli,mysqlnd,pdo到底是什么http://blog.csdn. ...

  7. 在Apache中安装php5.6 & php7.3

    1.下载 httpd-2.4.41-win64-VC15.zip.php5.6 +  vc11.  php7.3  + vc14-16 2.配置httpd,在 httpd.conf L180 添加如下 ...

  8. Linux centos7编译源码安装redis

    1.安装准备 ① 由于redis底层用c语言编写的,安装redis需要先将官网下载的源码进行编译,编译依赖make和gcc环境,如果没有则需要安装(一般系统中已经装了了make和gcc,无须再装) 安 ...

  9. 关于linux centos7 vmware 和windows7 文件共享笔记

    本方法是以win7,VMware9.0.1 ,centos6.4为基础实验的. 对于linux的初级使用阶段,都会Windows中使用linux虚拟机VMWare或者其它的.在Windows与linu ...

随机推荐

  1. Python学习之列表篇

    浮点数类型:round(x,d)可对浮点数进行四舍五入,科学计数法:aeb表示a*10^bpython大小写敏感整数类型:无范围限制,pow(x,y)表示x^y,想算多大算多大,四种表示形式:十进制, ...

  2. ZOJ1002 —— 深度优先搜索

    ZOJ1002 —— Fire net Time Limit: 2000 ms Memory Limit: 65536 KB Suppose that we have a square city wi ...

  3. Java开发中模拟接口工具moco的使用

    场景 在开发中需要依赖一些接口,比如需要请求一个返回Json数据的接口,但是返回Json数据的接口要么是没搭建,要么是交互比较复杂. 此时,就可以使用moco来模拟接口返回接口数据,以便开发和测试工作 ...

  4. Abaqus中的单位制

    量纲 SI SI/mm US/ft US/inct 长度 m mm ft in 载荷 N N lbf lbf 质量 kg kg3 slug lbfs2/in 时间 s s s s 量纲 SI SI/m ...

  5. 微软停止支持Windows 7 数百万台电脑将面临病毒等风险

    导读 微软给出的公告称,从2020年开始停止支持Windows 7操作系统,这意味着该公司不会再向数百万台电脑发布任何软件更新,包括可以防止网络攻击的软件补丁. 微软给出的公告称,从2020年开始停止 ...

  6. Ubuntu 安装 uWSGI

    uWSGI官方网址: https://pypi.org/project/uWSGI/ 使用如下命令安装: pip install uWSGI 报如下错: Collecting uWSGI Using ...

  7. Linux中限制用户邮件的大小

    Linux系统使用sendmail发送邮件,配置文件是/etc/sendmail.cf,缺省使用TCP/IP协议. 我们的Linux机器上往往会有多个用户同时工作,或者干脆就用它作邮件服务器,在同一时 ...

  8. Android系统架构(图解)

    下图是 Android 操作系统的架构,架构包括 4 层,由上到下依次是应用程序层.应用程序框架层.核心类库和 Linux 内核.其中,核心类库中包含系统库及 Android 运行环境. 图1  An ...

  9. Jmeter和nmon shell命令

    jmeter: sh jmeter -n -t /data/LPPZ/scripts/oauth.jmx -l /data/LPPZ/log/log.jtl nmon: ./nmon_linux_x8 ...

  10. 如何让div中的img图片显示在div下面。

    <!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>& ...