CentOS7编译安装php7.1
1.首先安装依赖包:
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel
2.下载PHP压缩包并解压:
wget http://php.net/distributions/php-7.1.0.tar.gz
tar -zxvf php-7.1.0.tar.gz
cd php-7.1.0
3.编译安装,编译的时候可能会出现各种报错情况,下一篇主要写编译是常见的错误及解决办法:
./configure \
--prefix=/usr/local/php \
--with-config-file-path=/etc \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-libxml-dir \
--with-xmlrpc \
--with-openssl \
--with-mcrypt \
--with-mhash \
--with-pcre-regex \
--with-sqlite3 \
--with-zlib \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-cdb \
--enable-dom \
--enable-exif \
--enable-fileinfo \
--enable-filter \
--with-pcre-dir \
--enable-ftp \
--with-gd \
--with-openssl-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext \
--with-gmp \
--with-mhash \
--enable-json \
--enable-mbstring \
--enable-mbregex \
--enable-mbregex-backtrack \
--with-libmbfl \
--with-onig \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-zlib-dir \
--with-pdo-sqlite \
--with-readline \
--enable-session \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-libxml-dir \
--with-xsl \
--enable-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-opcache
4.编译成功后安装:
make && make install
5.安装成功后配置环境变量:
为了使用方便,可以在 /etc/profile文件末尾添加php环境变量 :
PATH=$PATH:/usr/local/php/bin
export PATH
保存后刷新环境变量:
source /etc/profile #更新
查看环境变量:
echo $PATH
看到php环境变量的路径后,以后就可以直接使用php命令了,查看php版本:
php -v
6.现在的PHP没有.ini文件和配置文件,还需要配置PHP-FPM:
cp php.ini-production /etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.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 #启动
service php-fpm stop #停止
service php-fpm restart #重启

CentOS7编译安装php7.1的更多相关文章
- Centos7 编译安装PHP7
Centos7 编译安装PHP7 编译安装的方式可以让组件等设置更加合理,但需要你对PHP的代码及各种配置非常的熟悉,以下为大致的安装流程,大家可以参考 1.下载编译工具 yum groupinsta ...
- CentOS7编译安装php7.1配置教程详解
这篇文章主要介绍CentOS7编译安装php7.1的过程和配置详解,亲测 ,需要的朋友可以参考. 1.首先安装依赖包: yum install libxml2 libxml2-devel openss ...
- CentOS7 编译安装 php7
更新:2019-01-25 补充:CentOS 7.5 全新编译安装 PHP-7.3.1 ,补充内容接在原文之后 更新:2018-09-29 补充:新系统下编译安装PHP-7.2.5遇到的问题,补充内 ...
- centos7 编译安装 php7.3.11
1.安装依赖 yum install -y libxml2 *openssl* libcurl* libjpeg* libpng* freetype* libmcrypt* gcc gcc-c++ 2 ...
- centos7 编译安装 php7.4
1. 下载安装编译工具 yum groupinstall 'Development Tools' 2.安装依赖包 yum install libxml2 libxml2-devel openssl o ...
- centos7编译安装PHP7已经把你逼到去安定医院看门诊的地步?请看此文
本文援引自https://www.cnblogs.com/lamp01/p/10101659.html,亲测可行,特此鸣谢 地球上总有一群人是如此深爱PHP,但无奈的是编译安装的过程化特性,导致各种b ...
- centos7编译安装php7.2
去官网下载php7.2安装包,选择一个结点下载:http://php.net/downloads.php 下载:wget -ivh http://cn.php.net/distributions/ph ...
- CentOs7 编译安装PHP7.1.5
1 创建php用户和用户组,并在github下载php7源码 #######新建php用户和php组 [root@typecodes ~]# groupadd -r www && us ...
- Centos7 编译安装PHP7.2
yum install wget 在 /usr/local/src 目录下载php源码包 wget http://cn2.php.net/distributions/php-7.2.4.tar.gz ...
随机推荐
- spark计算两个DataFrame的差集、交集、合集
spark 计算两个dataframe 的差集.交集.合集,只选择某一列来对比比较好.新建两个 dataframe : import org.apache.spark.{SparkConf, Spar ...
- python 菱形继承问题究极版
如果只是正常的菱形继承,经典类(python2中最后一个父类不继承object类)是深度优先,即会从左边父类开始一路走到底 新式类(最后一个父类继承了object类)是广度优先,即从左边父类开始继承, ...
- Python内置函数(64)——tuple
英文文档: The constructor builds a tuple whose items are the same and in the same order as iterable‘s it ...
- selenium之 chromedriver与chrome版本映射表(更新至v2.43)
看到网上基本没有最新的chromedriver与chrome的对应关系表,便兴起整理了一份如下,希望对大家有用: chromedriver版本 支持的Chrome版本 chromedriver版本 支 ...
- qt 拖拽 修改大小
写次篇文章之前,qt窗口的放大缩小和拖拽我都是通过setGeometry方法实现的,但是作为windows程序,windows支持橡 皮筋式(拖拽时有一个虚框)拖拽和拉伸.通过setGeometry方 ...
- TP3.2框架中的字母函数解析
C的使用方法以及注意事项 使用方法: 1.读取配置 C('参数名称') 配置参数不区分大小写,存在则设置,否则返回NULL; 因为配置参数是全局有效的,因此C方法可以在任何地方读取任何配置,即使某个 ...
- MVC中Model元数据及绑定机制
ASP.NET MVC的Model为View Model,表示最终呈现在View上的数据,而Model元数据的一个重要的作用在于控制对象在View上的呈现方式.说得更加具体点,就是基于某种数据类型的M ...
- redis 系列5 数据结构之字典(上)
一. 概述 字典又称符号表(symbol table),关联数组(associative array), 映射(map),是一种用于保存键值对(key-value pair)的抽象数据结构.在字典中, ...
- Android软键盘事件imeOptions响应
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 在android发开过程中,有时候需要对EditText的软键盘进行监听. 当点击软键盘回车位置按键的时候,需要实现 完成.前进.下 ...
- Django项目开发
1.django中Form验证.CSRF.Cookie.Session.Model操作数据库 2.django介绍&快速实现简单留言系统 3.django开发在线教育网站