php 安装教程

本文采用php7.0.1作为样例,进行安装。

系统环境:

  CentOS6.7.

  gcc 4.8.2

  libzip 1.0.1


在安装之前,可以先更新CentOS系统。

yum -y update

下载相应依赖文件

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

wget "http://www.nih.at/libzip/libzip-1.0.1.tar.gz"

解压相应文件

tar xvf php-7.0.1.tar.gz
tar xvf libzip-1.0.1.tar.gz

安装libzip库

cd libzip-1.0.1
./configure
make & make install

安装依赖包

此处可能会碰到so文件找不到的情况。由于为搜索/usr/lib64目录的原因,一般的解决方法就是直接软连接过去。

yum -y install gmp-devel libc-client-devel
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
ln -s /usr/lib64/libldap* /usr/lib/

编译安装PHP7.0.1

./configure --prefix=/usr/local/php701 --enable-fpm  --with-fpm-user=www --with-fpm-group=www --with-kerberos --with-openssl --with-pcre-regex --with-zlib     --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --with-gd --with-gettext --with-gmp --enable-gd-jis-conv --enable-gd-native-ttf --with-imap --with-imap-ssl  --enable-intl  --with-ldap --enable-mbstring --with-libmbfl --with-mcrypt --with-mysqli --with-mysql-sock  --enable-pcntl --with-pdo-mysql --enable-soap  --enable-sockets  --with-xmlrpc --with-xsl --enable-zip --enable-mysqlnd --enable-maintainer-zts --enable-zend-signals
make & make install
ln -s /usr/local/php701/bin/php /usr/local/bin/
ln -s /usr/local/php701/bin/phpize /usr/local/bin/
ln -s /usr/local/php701/bin/php-config /usr/local/bin/

安装redis for php 扩展

由于redis master 分支暂时不支持 php7.0.1,所以,使用phpredis支持php7的分支进行安装

wget 'https://github.com/phpredis/phpredis/archive/php7.zip'
unzip php7.zip
cd phpredis-php7
phpize
./configure
make & make install

安装memcached for php 扩展

memcached 依赖 libmemcached 和 libevent 两个包

安装libevent

wget 'https://github.com/nmathewson/Libevent/archive/release-2.0.22-stable.tar.gz'
tar xvf release-2.0.22-stable.tar.gz
cd Libevent-release-2.0.22-stable/
./configure && make && make install

安装libmemcached

wget 'https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz'
tar xvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18 ./configure make && make install

安装php-memcached

由于memcached目前版本不支持php7.1,在php-memcached讨论中找到了这个解决方法。

git clone 'https://github.com/rlerdorf/php-memcached.git'
cd php-memcached/
phpize
./configure
make && make install

 

至此,php 7.0.1 已安装完毕。

安装扩展如下:

'./configure'  '--prefix=/usr/local/php701' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-debug' '--with-kerberos' '--with-openssl' '--with-pcre-regex' '--with-zlib' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl' '--enable-exif' '--enable-ftp' '--with-gd' '--with-gettext' '--with-gmp' '--enable-gd-jis-conv' '--enable-gd-native-ttf' '--with-imap' '--with-imap-ssl' '--enable-intl' '--with-ldap' '--enable-mbstring' '--with-libmbfl' '--with-mcrypt' '--with-mysqli' '--with-mysql-sock' '--enable-pcntl' '--with-pdo-mysql' '--enable-soap' '--enable-sockets' '--with-xmlrpc' '--with-xsl' '--enable-zip' '--enable-mysqlnd' '--enable-maintainer-zts' '--enable-zend-signals'

  

  

php 安装教程的更多相关文章

  1. Linux+apache+mono+asp.net安装教程

    Linux+apache+mono+asp.net安装教程(CentOS上测试的) 一.准备工作: 1.安装linux系统(CentOS,这个就不多讲了) 2.下载所需软件 http-2.4.4.ta ...

  2. Greenplum 源码安装教程 —— 以 CentOS 平台为例

    Greenplum 源码安装教程 作者:Arthur_Qin 禾众 Greenplum 主体以及orca ( 新一代优化器 ) 的代码以可以从 Github 上下载.如果不打算查看代码,想下载编译好的 ...

  3. git 安装教程

    昆,简单说下安装教程1,安装Git2,安装TortoiseGit3,打开第一步安装的git工具GIT BASH

  4. Docker和Docker-compose安装教程以及docker-elk,docker-storm安装教程

    此安装教程仅供我自己安装配置时查看,其他的人不可以偷看!!! 安装Docker 1. Update package information, ensure that APT works with th ...

  5. RHEL 6.3 详细安装教程

    以前刚接触linux时,什么都不懂,为了学习,在电脑上安装双系统(原系统为Win7),吃过不少苦头,在网上搜教程,很多都是语焉不详,导致安装过程中战战兢兢.最近朋友面试运维,面试官有考他对linux安 ...

  6. Android Studio的下载和安装教程(从ADT到AS)

    之前一直使用的是Android development tools(简称ADT),后来说是google对ADT不再提供支持,然后一直在考虑是否把自己电脑换成Android Studio(简称AS),从 ...

  7. mysql快速导出数据库ER图和数据字典(附navicat11安装教程及资源)

    ♣ mysql使用navicat11快速导出数据库ER图 ♣ mysql使用navicat11快速导出数据库数据字典 ♣ navicat11 for mysql (这里是mysql5.7.12)专业版 ...

  8. Smokeping安装教程

    Smokeping安装教程 #Smokeping2.6.8安装教程 #2016.3.6 改编v1.0 #Linux运维技术交流 347163978   环境 CentOS release 6.4 (F ...

  9. (二)ADS1.2的安装教程以及使用 调试 (不会 AXD 调试工具)

    安装教程: 参考百度 http://jingyan.baidu.com/article/cdddd41c7db85253cb00e1ae.html 具体使用看: 杨铸的那本书(嵌入式底层软件驱动开发) ...

  10. hadoop 安装教程 转载

    hadoop2.2安装教程:http://www.aboutyun.com/thread-7684-1-1.html hadoop2.X使用手册1:通过web端口查看主节点.slave1节点及集群运行 ...

随机推荐

  1. Javascript Event事件中IE与标准DOM的区别

    1.事件流的区别 <body> <div> <button>点击这里</button> </div> </body> IE采用冒 ...

  2. ysoserial源码结构分析

    1.前言 之前也花了几天晚上熟悉了一下commonscollections系列的构造,那么学习一下这个项目是如何设计的也挺重要,多学习大佬如何写代码应该也能对自己的代码能力有提升吧~2333 2.项目 ...

  3. Python之locust踩坑指北

    坑点1:locust安装报错 其中一种情况:error:Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visua ...

  4. 一个交互式可视化Python库——Bokeh

    本篇为<Python数据可视化实战>第十篇文章,我们一起学习一个交互式可视化Python库--Bokeh. Bokeh基础 Bokeh是一个专门针对Web浏览器的呈现功能的交互式可视化Py ...

  5. 我在使用DriverManager时发现的问题

    小白今天在连接数据库的时候,心里面突然想起之前有大佬说没有必要添加一条"com.mysql.jdbc.Driver",当时也实验了确实可行,但是这个可是驱动地址,难道是不用添加是根 ...

  6. Kafka 详解(转)

    转载自:https://blog.csdn.net/lingbo229/article/details/80761778 Kafka Kafka是最初由Linkedin公司开发,是一个分布式.支持分区 ...

  7. JavaScript初学者

    学习如逆水行舟,不进则退.要逆流而上,逆战! 学习JavaScript这门语言,作为一个初学者,最重要的就是扎实的基础. 只要有了扎实的功底,在后期的学习中才能来去自如的应对各种逻辑难题 下面我们就来 ...

  8. 从零开始学习R语言(二)——数据结构之“因素(Factor)”

    本文首发于知乎专栏:https://zhuanlan.zhihu.com/p/60101041 也同步更新于我的个人博客:https://www.cnblogs.com/nickwu/p/125370 ...

  9. 全国职业技能大赛信息安全管理与评估-MySQL爆破脚本

    DEMO: #coding=utf-8 import MySQLdb class MSSQL: def __init__(self,host,user,pwd): self.host = host s ...

  10. identityserver4源码解析_2_元数据接口

    目录 identityserver4源码解析_1_项目结构 identityserver4源码解析_2_元数据接口 identityserver4源码解析_3_认证接口 identityserver4 ...