centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM)
一、下载php7源码包
http://php.net/downloads.php
如:php-7.0.15.tar.gz
二、安装所需依赖
> yum -y install gd-devel zlib-devel libjpeg-devel libpng-devel libiconv-devel freetype-devel libxml2 libxml2-devel openssl openssl-devel curl-devel libxslt-devel libmcrypt-devel mhash mcrypt
如果无法安装libiconv,请手动下载安装
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
> tar xf libiconv-1.14.tar.gz
> cd libiconv-1.14
> ./configure --prefix=/usr/local/libiconv
> make && make install
如果出现如下问题,说明你系统版本较高。
./stdio.h:1010:1: 错误:‘gets’未声明(不在函数内)
> cd srclib/
> sed -i -e '/gets is a security/d' ./stdio.in.h
> cd ../
> make && make install
如果安装libmcrypt-devel、mhash、mcrypt出错,则重新配置yum源。
http://mirrors.163.com/.help/centos.html
http://mirrors.aliyun.com/help/centos
三、编译PHP
创建账号
> useradd -s /sbin/nologin -M nginx
> tar xf php-7.0.15.tar.gz
> cd /data/php-7.0.15
> ./configure --prefix=/data/php7 \
--with-openssl \
--with-pcre-regex \
--with-kerberos \
--with-libdir=lib \
--with-libxml-dir \
--with-mysqli=shared,mysqlnd \
--with-pdo-mysql=shared,mysqlnd \
--with-pdo-sqlite \
--with-gd \
--with-iconv \
--with-zlib \
--with-xmlrpc \
--with-xsl \
--with-pear \
--with-gettext \
--with-curl \
--with-png-dir \
--with-jpeg-dir \
--with-freetype-dir \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-mysqlnd \
--enable-zip \
--enable-inline-optimization \
--enable-shared \
--enable-libxml \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-sockets \
--enable-soap \
--enable-session \
--enable-opcache \
--enable-fpm \
--enable-maintainer-zts \
--enable-fileinfo \
四、make && make install
> make && make install
五、配置文件
> cp /data/php-7.0.15/php.ini-development /data/php7/lib/php.ini
> cp -R /data/php-7.0.15/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
> cp /data/php7/etc/php-fpm.conf.default /data/php7/etc/php-fpm.conf
> cp /data/php7/etc/php-fpm.d/www.conf.default /data/php7/etc/php-fpm.d/www.conf
六、修改php.ini
> mkdir /data/php7/tmp
> chmod 766 /data/php7/tmp
extension_dir = "/data/php7/lib/php/extensions/no-debug-zts-20151012/"
session.save_path = "/data/php7/tmp"
date.timezone = PRC
七、添加环境变量
> echo 'export PATH=/data/php7/bin:/data/php7/sbin:$PATH' >> /etc/profile
> source /etc/profile
八、添加自启动
> chkconfig --add php-fpm
> chkconfig php-fpm on
> chkconfig --list php-fpm
九、启动服务
> chmod 755 /etc/init.d/php-fpm
> service php-fpm start
> ps -ef|grep php-fpm
十、php-fpm重启
php-fpm的pid文件默认在你php安装目录下var/run/php-fpm.pid
当然这是可以更改的,在/data/php7/etc/php-fpm.conf文件中
关闭
> kill -INT `cat /data/php7/var/run/php-fpm.pid`
重启
> kill -USR2 `cat /data/php7/var/run/php-fpm.pid`
centos7下编译安装php-7.0.15(PHP-FPM)的更多相关文章
- centos7下编译安装nginx-1.16.0
一.下载nginx源码 http://nginx.org/en/download.html 如:nginx-1.16.0.tar.gz 二.创建用户和组,并解压 groupadd www userad ...
- CentOS7下编译安装redis-5.0.9
CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...
- 在CUDA8.0下编译安装OpenCV3.1.0来实现GPU加速(Compiling OpenCV3.1.0 with CUDA8.0 support)
在CUDA8.0下编译安装OpenCV3.1.0 一.本人电脑配置:ubuntu 14.04, NVIDIA GTX1060. 二.编译OpenCV3.1.0前,读者需要成功安装CUDA8.0(网上有 ...
- Ubuntu16.04下编译安装OpenCV3.4.0(C++ & python)
Ubuntu16.04下编译安装OpenCV3.4.0(C++ & python) 前提是已经安装了python2,python3 1)安装各种依赖库 sudo apt-get update ...
- centos7下编译安装redis5.05
准备环境: 1.一台centos7机器,配置没有什么要求(能联网) 2.下载好redis压缩包 下载redis包: 1.登录redis官网: https://redis.io/download 2.选 ...
- OSX下编译安装opencv3.1.0与opencv_contrib_master
OSX版本10.11.3 1.安装homebrew,打开终端,写入指令 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Hom ...
- CentOS7 下编译安装 Samba,什么是 SMB/CIFS 协议
目录 一.关于 Samba 1. SMB 2. Samba 二.yum 安装 Samba 1. 安装 Samba 2. 查看版本 3. 查看配置文件 4. 启动服务 5. 本地客户端验证 6. Win ...
- centos7下编译安装php7.3
一.下载php7.3的源码 https://www.php.net/downloads.php 下载php-7.3.4.tar.gz 二.安装gcc,gcc-c++,kernel-devel yum ...
- Centos6下编译安装gcc6.4.0
Centos6自带的gcc4.4.7不支持c++11, 于是编译安装最新版的gcc wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz .tar ...
随机推荐
- SVM的sklearn.svm.SVC实现与类参数
SVC继承了父类BaseSVC SVC类主要方法: ★__init__() 主要参数: C: float参数 默认值为1.0 错误项的惩罚系数.C越大,即对分错样本的惩罚程度越大,因此在训练样本中准确 ...
- 用 Django 做了一个照片分享网站
最近翻了一下过去做过的东西,找到了这个绿光照片分享,于是就拿来分享了.项目地址在: https://github.com/restran/green-glow 这是我2012年的一个课程作业,实现的功 ...
- SpringMVC 之@RequestBody 接收Json数组对象
1. 摘要 程序流程: 前台使用ajax技术,传递json字符串到后台: 后台使用Spring MVC注解@RequestBody 接受前台传递的json字符串,并返回新的json字符串到前台: 前台 ...
- jquery 隐藏 显示 动画效果
<!DOCTYPE html> <html> <head> <script src="/jquery/jquery-1.11.1.min.js&qu ...
- 浅谈RMI的特点及作用
RMI:远程方法调用(Remote Method Invocation) 扩展:RPC与RMI的区别 1:方法调用方式不同: RMI中是通过在客户端的Stub对象作为远程接口进行远程方法的调用.每个远 ...
- fb 更新sdk
flash兼容flex.fb的sdk,但fb不一定兼容flash的sdk,那么直接将flash的sdk解压覆盖掉fb的sdk,就可以打开了. fb更新sdk方法: 1.找到(安装目录+eclipse\ ...
- AS3 巧用事件api简化鼠标拖动流程
拖动,按照一般人的定义,拖动就是鼠标按下的时候移动鼠标,这里面有三个过程,分别是按下.移动鼠标和弹起.以stage为例,大家的实现步骤通常如下:(PS:此处不讨论startDrag和stopDrag ...
- mysql启动报错 The server quit without updating PID file
[root@uz6542 data]# /etc/init.d/mysqld startStarting MySQL... ERROR! The server quit without updatin ...
- pyDes库 实现python的des加密
下载及简介地址:https://twhiteman.netfirms.com/des.html 如需要在python中使用des加密,可以直接使用pyDes库加密,该库提供了CBC和ECB两种加密方式 ...
- 扩展C#与元编程(二)
如果你对Windows Workflow Foundation(WF)一无所知,当看到扩展C#与元编程(一)中由MW编译器生成的FirstLook.mw.cs时,也许这么在想:我KAO,这是C#版的汇 ...