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 ...
随机推荐
- ubuntu18.04修改时区
运行如下命令: sudo tzselect 然后选择亚洲Asia,继续选择中国China,最后选择北京Beijing. 然后创建时区软链 sudo ln -sf /usr/share/zoneinfo ...
- Design a high performance cache for multi-threaded environment
如何设计一个支持高并发的高性能缓存库 不 考虑并发情况下的缓存的设计大家应该都比较清楚,基本上就是用map/hashmap存储键值,然后用双向链表记录一个LRU来用于缓存的清理.这篇文章 应该是讲得很 ...
- DRL 教程 | 如何保持运动小车上的旗杆屹立不倒?TensorFlow利用A3C算法训练智能体玩CartPole游戏
本教程讲解如何使用深度强化学习训练一个可以在 CartPole 游戏中获胜的模型.研究人员使用 tf.keras.OpenAI 训练了一个使用「异步优势动作评价」(Asynchronous Advan ...
- uva-10160-枚举
若当前搜索到的城市n前面1-n-1编号的城市中有没有通电的,则永远也无法输送电力给那个城市,因为在剪枝时附加了和此结点连接的最大结点小于当前的结点 这段 for(int i = 1; i < c ...
- python3基础:字符串、文本文件
字符串: 练习1: str = "大胖三百磅不是二百磅陪着一百磅的小胖" print(str.replace("磅", "斤")) # 替换 ...
- WINRAR 自解压脚本命令及变量
自解压脚本命令 Path=d:\ ;绝对路径 ;Path=.\在当前文件夹中创建 ;Path=在“Program Files”中创建 ;在当前文件夹创建,无语句 Setup=释放后运行 Presetu ...
- windows installer 应用变换时的错误.请验证指定的变换路径是否有
安装Windows Installer Clean Up 清理一下残留的项目之后再装或者手动去注册表找 HKEY_CLASSES_ROOT\Installer\Products\ 下面的"子 ...
- jemalloc for mysql
ptmalloc 是glibc的内存分配管理 tcmalloc 是google的内存分配管理模块 jemalloc 是BSD的提供的内存分配管理 三者jemalloc和tcmalloc的性能不分伯仲, ...
- ActiveMQ安全设置:设置admin的用户名和密码
ActiveMQ使用的是jetty服务器, 打开conf/jetty.xml文件,找到 <bean id="securityConstraint" class="o ...
- Servlet Response 重定向
重定向 response.sendRedirect("index.jsp"); //登录用户名不存在,重定向到index.jsp 1重定向在客户端发挥作用,通过浏览器重 ...