安装 PHP5

PHP官网www.php.net
• 当前主流版本为5./7.1
• cd /usr/local/src/
• wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
• tar zxvf php-5.6..tar.gz
• cd php-5.6.
• ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2./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 • 问题1
configure: error: xml2-config not found. Please check your libxml2 installation.
[root@centos7 php-5.6.]# yum list |grep xml2
[root@centos7 php-5.6.]# yum install -y libxml2-devel.x86_64  • 问题2
configure: error: Cannot find OpenSSL's <evp.h>
[root@centos7 php-5.6.]# yum install -y openssl-devel • 问题3
configure: error: Please reinstall the BZip2 distribution
[root@centos7 php-5.6.]# yum install -y bzip2-devel • 问题4
configure: error: jpeglib.h not found.[root@centos7 php-5.6.]# yum install -y libjpeg-devel • 问题5
configure: error: png.h not found.
[root@centos7 php-5.6.]# yum install -y libpng-devel • 问题6
configure: error: freetype-config not found.
[root@centos7 php-5.6.]# yum install -y freetype-devel • 问题7
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
安装epel扩展源[root@centos7 php-5.6.]# yum install -y epel-release
[root@centos7 php-5.6.]# yum install -y libmcrypt-devel • make && make install • php二进制文件 /usr/local/php/bin/php • 配置文件[root@centos7 php-5.6.]# cp php.ini-production  /usr/local/php/etc/php.ini
• cp php.ini-production /usr/local/php/etc/php.ini
• php配置信息[root@centos7 php-5.6.]# /usr/local/php/bin/php -i |less

安装php7

• cd /usr/local/src/
• wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2
• tar jxvf php-7.1..tar.bz2
• cd php-7.1.
./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2./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./modules/libphp7.so
• 查看php加载的模块[root@centos7 php-7.1.]# /usr/local/php7/bin/php -m
• cp php.ini-production /usr/local/php7/etc/php.ini
• apacha使用哪一个PHP?
编辑配置文件: vim /usr/local/apache2./conf/httpd.conf
搜索php,不想用哪个php版本 注释掉即可。

安装PHP5 PHP7的更多相关文章

  1. 记 Mac Pro 系统升级后,编译安装 PHP-5.6.28 / PHP-7.0 报错修复过程

    买 Mac Pro 的时候,系统为 OS X 10.11.5,编译 PHP-5.6.21 的时候,也遇到一些坑,安装过程记录如下: Mac Pro 编译安装 PHP 5.6.21 及 问题汇总 后来, ...

  2. yum安装php5.5,php5.6和php7.0

    本文主要介绍在CentOS系统下的php多个版本的安装使用 1.清理系统上的旧版本php 1)查询已安装的php软件 rpm -qa|grep php* yum list installed | gr ...

  3. ubuntu16.04 卸载 php7并安装php5.6记录

    ubuntu16.04版本从默认源安装的php版本为7.x版本,我们都知道php7.0已经舍弃了很多旧版本的函数等内容,这对旧系统来说是致命的,那么,我们就有了安装旧版php的需求,而同一主机安装两个 ...

  4. 安装PHP5和PHP7

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

  5. centos安装php5、卸载php、安装php7

    这篇文章主要介绍了centos安装php5.卸载php.安装php7 ,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下 首先安装php5很简单 yum install php 然后如果不 ...

  6. Linux CentOS7 VMware 安装PHP5 、安装PHP7

    一.安装PHP5 PHP官网www.php.net 当前主流版本为5.6/7.1 cd /usr/local/src/ wget http://cn2.php.net/distributions/ph ...

  7. 使用PPA在Ubuntu上安装php5.4~5.6,7

    使用PPA在Ubuntu上安装php5.4~5.6,7 sudo apt-get install software-properties-common sudo add-apt-repository ...

  8. Ubuntu 16.04系统下安装PHP5.6*

    Ubuntu 16.04系统默认php7,并没有php5*的包,所以需要自己安装: 方法: 1.删除所有的php包列出安装的php包,dpkg -l | grep php| awk '{print $ ...

  9. 树莓派安装 Nginx + PHP7.0 + Pi Dashboard

    之前我们介绍过树莓派搭建LNMP环境的方法,以及给树莓派装一个仪表盘来监控树莓派运行状态.近期有用户反馈树莓派最新版的系统已经无法找到 PHP5 的软件包了,这是因为新版本已经用 PHP7 替代了 P ...

随机推荐

  1. iOS中大文件下载(单线程下载)

    主要是需要注意,在客服端发请求给服务器的时候,在请求头里是可以设置服务器返回的数据从哪开始,到哪结束的. 当服务器响应客户端时,是可以拿到服务器返回数据具体类型以及大小的 思路: 在接收到服务器响应时 ...

  2. vs2015利用python加载dll调试配置

    python调用dll相对而言比较方便,写个脚本调试轻松工作,快乐生活. python脚本 from ctypes import * import time # 脚本挂起 input() # load ...

  3. C语言字符串格式化显示

    符号                  作用 ──────────────────────────     %d              十进制有符号整数     %i              输 ...

  4. Javascript eval()函数 基础回顾

    如果您想详细了解ev al和JSON请参考以下链接: eval  :https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Glo ...

  5. 基于jQuery果冻式按钮焦点图切换代码

    基于jQuery果冻式按钮焦点图切换代码.这是一款基于jQuery+CSS3实现的图片切换代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div class=&quo ...

  6. Mongodb 的常用方法,在可视化工具执行

    查询: db.getCollection('message').find({"userId":"31257"}) 查询总数: db.getCollection( ...

  7. nginx中的break与last指令区别

    很多人资料说,last与break的区别在于,last并不会停止对下面location的匹配.我理解上模模糊糊.今天自己来测验了一下. rewrite 指令末尾的break应该与单独写break作用是 ...

  8. 【WPF】右键菜单ContextMenu可点击区域太小的问题

    问题描述 正常使用右键菜单ContextMenu时,如果菜单项是不变的,可以直接在XAML中写死,如下是给一个Button按钮添加了右键菜单功能. <Button Content="T ...

  9. kd-tree理论以及在PCL 中的代码的实现

    (小技巧记录:博客园编辑的网页界面变小了使用Ctrl  ++来变大网页字体) 通过雷达,激光扫描,立体摄像机等三维测量设备获取的点云数据,具有数据量大,分布不均匀等特点,作为三维领域中一个重要的数据来 ...

  10. combobox无法显示选中的数据,都是undefined

    $('#firstfactor').combobox({                url: '@Url.Action("GetMultiAirFactor_Day_New", ...