centos 源码安装php5.5
系统环境:
CentOS 6.5 / 7.0 x86_64
Fedora 20 x86_64
下载 PHP 源码包
# wget http://cn2.php.net/distributions/php-5.5.15.tar.bz2
# tar xf php-5.5.15.tar.bz2 -C /usr/local/src/
添加 epel 源
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
安装依赖
# yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel
创建 www 用户
# groupadd www
# useradd -g www -s /sbin/nologin -M www
编译安装
# cd /usr/local/src/php-5.5.15/
# ./configure \
--prefix=/usr/local/php \
--with-config-file-path=/etc \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-opcache \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gettext \
--enable-mbstring \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-openssl \
--enable-bcmath \
--enable-soap \
--with-libxml-dir \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl \
--with-zlib \
--enable-zip \
--with-bz2 \
--with-readline \
--without-sqlite3 \
--without-pdo-sqlite \
--with-pear
参数说明:
""" 安装路径 """
--prefix=/usr/local/php \
""" php.ini 配置文件路径 """
--with-config-file-path=/etc \
""" 优化选项 """
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
""" 启用 opcache,默认为 ZendOptimizer+(ZendOpcache) """
--enable-opcache \
""" FPM """
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
""" MySQL """
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
""" 国际化与字符编码支持 """
--with-gettext \
--enable-mbstring \
--with-iconv \
""" 加密扩展 """
--with-mcrypt \
--with-mhash \
--with-openssl \
""" 数学扩展 """
--enable-bcmath \
""" Web 服务,soap 依赖 libxml """
--enable-soap \
--with-libxml-dir \
""" 进程,信号及内存 """
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
""" socket & curl """
--enable-sockets \
--with-curl \
""" 压缩与归档 """
--with-zlib \
--enable-zip \
--with-bz2 \
""" GNU Readline 命令行快捷键绑定 """
--with-readline \
""" 禁用 SQLite 支持扩展 """
--without-sqlite3 \
--without-pdo-sqlite \
""" 更多 PHP 扩展与应用库 """
--with-pear
如果你的 Web Server 使用的 Apache 请添加类似:--with-apxs2=/usr/local/apache/bin/apxs 参数。
关于 mysqlnd 请查看 什么是 PHP 的 MySQL Native 驱动? 或查看 MySQL 官方介绍:MySQL native driver for PHP, 或 Installation on Unix。
更多编译参数请使用 ./configure --help 查看。
# make -j4
# make install
如果想重新安装:
# make clean
# make clean all
# ./configure ...
# make -j4
# make install
配置 PHP
配置文件:
# cp php.ini-development /etc/php.ini
PHP-fpm 服务
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
# chmod +x /etc/init.d/php-fpm
启动 php-fpm
# service php-fpm start
Starting php-fpm done
php-fpm 可用参数 start|stop|force-quit|restart|reload|status
添加 PHP 命令到环境变量
编辑 ~/.bash_profile,将:
PATH=$PATH:$HOME/bin
改为:
PATH=$PATH:$HOME/bin:/usr/local/php/bin
使 PHP 环境变量生效:
# . ~/.bash_profile
查看看 PHP 版本
# php -v
PHP 5.5.15 (cli) (built: Aug 3 2014 02:43:38)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
centos 源码安装php5.5的更多相关文章
- centos 6.4 源码安装php5.4 mysql5.5 apahce2
centos 6.4 源码安装php5.4 mysql5.5 apahce2 博客分类: php 参考:http://blog.csdn.net/simpleiseasy/article/deta ...
- CentOS源码安装QT
在VirtualBox上的CentOS下安装qt-everywhere-opensource-src-4.8.4 ,执行 ./confiure时失败,失败信息为:Basic XLib function ...
- 简单说明CentOS源码安装程序
第一步.安装依赖包.一般官网会有依赖关系,没有就网上搜索一下. 第二步.下载源码包,上传至CentOS服务器 第三步.解压缩 第四步.进入源码文件夹 第五步.执行./configure,这一步主要是为 ...
- CentOS 源码安装MySQL5.7
一.安装方式源码安装,源码包名称mysql-boost-5.7.27.tar.gz,此版本包含boost库,在解压后的boost路径下.安装时,可以-DDOWNLOAD_BOOST=1 -DWITH_ ...
- CentOS源码安装Wireshark
(2019年2月19日注:这篇文章原先发在自己github那边的博客,时间是2016年8月25日) Wireshark为网络管理员常用的一个网络管理工具,通过使用这个软件,我们可以对本机网卡上的经过的 ...
- linux(centos)源码安装git
最近使用一个开源库,部署的的时候需要用git克隆依赖库.刚好系统没安装git.就尝试了源码安装git. 源码下载地址:http://codemonkey.org.uk/projects/git-sna ...
- CentOS源码安装 Tomcat/8.0.24
依个人的习惯,喜欢将源码安装在/usr/local这个目录下面: 第一步:下载源码 wget http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.2 ...
- Centos源码安装Python3
CentOS7默认安装了python2.7.5,当需要使用python3的时候,可以手动下载Python源码后编译安装. 下载python(https://www.python.org/ftp/pyt ...
- CentOS源码安装搭建LNMP全过程(包括nginx,mysql,php,svn)【转】
转自:http://blog.csdn.net/yanzi1225627/article/details/49123659 服务器环境为:CentOS6.5 64位 目标:搭建LNMP(Linux + ...
随机推荐
- 怎么用源程序把ChemDraw结构复制到Word文档
在学习化学过程中,不可避免的会接触到各种化学结构.这个时候就需要通过绘制化学结构来进行这方面的学习和传播.ChemDraw Professional 15就可以辅助完成这方面的工作.很多的用户朋友会通 ...
- Lucene索引文件组成
Lucene的索引里面存了些什么,如何存放的,也即Lucene的索引文件格式,是读懂Lucene源代码的一把钥匙. 当我们真正进入到Lucene源代码之中的时候,我们会发现: Lucene的索引过程, ...
- Tomcat设置maxPostSize导致Post请求不过去
问题:最近部署项目,用到的Tomcat 版本:7.0.82.0,发现一直登陆不了,查询发现原来前端的数据传递不到后端 排查问题:通过debug日志发现,后端没有接受到前端用户的登陆数据,检查发现Tom ...
- 【网络编程】之十三、ping程序实现
使用原始套接字:SOCK_RAW 需要ICMP 代码如下: #include<iostream> #include<WinSock2.h> using namespace st ...
- 1060 最复杂的数(反素数玄学dfs)
1060 最复杂的数 题目来源: Ural 1748 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 把一个数的约数个数定义为该数的复杂程度,给出一个n,求1-n中 ...
- ibatis 大于等于小于等于的写法
在ibatis的sql语句xml配置文件中,写sql语句会经常用到大于等于小于等于等等符号.网上搜罗了一些写法,大致有3种: 其实就是xml特殊符号,转义的方式. < < > > ...
- Redis 持久化机制
1.背景 之前在使用redis 时候,没有过多的考虑持久化! 但是这样即使你用了redis 也是徒劳,表面上你是用上了redis 进行缓存数据,感觉已经给自己的架构添加了一个道QPS 防护墙! 哈哈, ...
- an open source web server and reverse proxy
https://www.nginx.com/resources/admin-guide/ NGINX is an open source web server and reverse proxy th ...
- spring cloud 微服务应用间通讯
SpringCloud 应用间通信基于HTTP的Restful调用方式有两种,RestTemplate与Feign. 1.RestTemplate应用间通讯 通过 @LoadBalanced,可在re ...
- 如何将大数据保存到 MySql 数据库
1. 什么是大数据 1. 所谓大数据, 就是大的字节数据,或大的字符数据. 2. 标准 SQL 中提供了如下类型来保存大数据类型: 字节数据类型: tinyblob(256B), blob(64K), ...