Linux CentOS7 VMware 安装PHP5 、安装PHP7
一、安装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的更多相关文章
- Linux CentOS7 VMware 安装软件包的三种方法、rpm包介绍、rpm工具用法、yum工具用法、yum搭建本地仓库
一.安装软件包的三种方法 Linux下游三种安装方法,rpm工具.yum工具.源码包.rpm按装一个程序包时,有可能因为该程序包依赖另一个程序包而无法安装:yum工具,可以连同依赖的程序包一起安装. ...
- Linux CentOS7系统中php安装配置
本篇讲解如何配置php开发环境,让你的php代码可以正常的在网页中运行. 准备工作 linux centos7操作系统 ssh软件 nginx php资源 想要了解更多关于php的内容,请访问: ph ...
- linux(centos7) nginx php mysql安装
环境: linux:centos7 php:7.0 基础命令 // yum install -y lrzsz // centos7 默认已安装yum install epel-release ngin ...
- Linux CentOS7系统中phpMyAdmin安装配置
今天介绍的是如何在Linux CentOS7系统中配置phpMyAdmin. 目录 环境准备 安装包 基本设置 网站预览 环境准备 linux centos7系统 ssh软件 php语言环境 mysq ...
- Linux CentOS7系统中mysql8安装配置
mysql是世界上最流行的关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司所有.今天我将记录一下如何在Linux centos7系统上安装和配置MySQL. 目录 环境准 ...
- 安装PHP5和PHP7
5月25日任务 课程内容: 11.10/11.11/11.12 安装PHP511.13 安装PHP7php中mysql,mysqli,mysqlnd,pdo到底是什么http://blog.csdn. ...
- 在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 添加如下 ...
- Linux centos7编译源码安装redis
1.安装准备 ① 由于redis底层用c语言编写的,安装redis需要先将官网下载的源码进行编译,编译依赖make和gcc环境,如果没有则需要安装(一般系统中已经装了了make和gcc,无须再装) 安 ...
- 关于linux centos7 vmware 和windows7 文件共享笔记
本方法是以win7,VMware9.0.1 ,centos6.4为基础实验的. 对于linux的初级使用阶段,都会Windows中使用linux虚拟机VMWare或者其它的.在Windows与linu ...
随机推荐
- leetCode练题——7. Reverse Integer
1.题目: 7. Reverse Integer Given a 32-bit signed integer, reverse digits of an integer. Example 1: I ...
- mui 进度条 隐藏
官方提供的 mui(contanier).progressbar().hide(); 并未起作用,DOM是js动态添加的,结果无法隐藏.(越使用,mui 的坑越多,陆续记录中...) 后使用下面的方法 ...
- 前端一面/面试常考题1-页面布局:假设高度已知,请写出三栏布局,其中左栏、右栏宽度各为300px,中间自适应。
题目:假设高度已知,请写出三栏布局,其中左栏.右栏宽度各为300px,中间自适应. [题外话:日常宣读我的目标===想要成为一名优雅的程序媛] 一.分析 1. 题目真的像我们想得这么简单吗? 其实不然 ...
- Linux03——磁盘分区和挂载
Windows下的磁盘分区: 常用的两种磁盘分区类型 mbr: 操作系统安装在主分区 只支持4个主分区 拓展分区占一个主分区 gpt(win7 64位之后) 无限主分区 支持超大硬盘3T以上 查看所有 ...
- 查看svn 提交记录
svn log -v -r {2019-8-11}:{2019-8-16} -l 30 | sed -n '/wangyue01/,/--$/ p'其中:-r {2018-9-10}:{2018-9- ...
- <位运算> 任意二进制数 异或两个相同的二进制数 还是原本的值
二进制,即0与1. 因为两个相同的二进制 异或必为0.(类似于不进位加法) 二进制里与0异或为其原本的0与1.. 可得任意二进制数 异或两个相同的二进制数 还是原本的值. 可用于交换和加密.
- linux查看公网ip的方法
curl ifconfig.me 或者 curl cip.cc
- 计算机二级-C语言-程序填空题-190110记录-文件写入与文件读出显示
//给定程序功能是:从键盘输入若干行文本(每行不超过80个字符),写到文件myfile4.txt中,用-1(独立一行)作为字符串输入结束的标志,然后将文件的内容读到显示在屏幕上.文件的读写分别由自定义 ...
- PyQt5四大布局方式
1.绝对布局方式'''绝对布局方式,通过move的XY坐标方式来控制控件的位置'''from PyQt5.QtWidgets import *import sys,math class absolut ...
- 【剑指Offer面试编程题】题目1508:把字符串转换成整数--九度OJ
题目描述: 将一个字符串转换成一个整数,要求不能使用字符串转换整数的库函数. 输入: 输入可能包含多个测试样例. 对于每个测试案例,输入为一个合法或者非法的字符串,代表一个整数n(1<= n&l ...