CentOS 7解压安装PHP7.1.21
下载php
yum install -y wget
wget http://cn2.php.net/distributions/php-7.1.21.tar.gz
解压
tar -zxvf php-7.1.21.tar.gz
cd php-7.1.21
编译:
# 安装epel
yum install -y epel-release
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 安装编译依赖
yum install -y 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 gcc
# 创建目录
mkdir -p /data/service/php/etc
./configure \
--prefix=/data/service/php \
--with-config-file-path=/data/service/php/etc \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--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
make && make install
增加环境变量
cat <<EOF > /etc/profile.d/php.sh
export PATH=/data/service/php/bin:\$PATH
EOF
# 生效环境变量
. /etc/profile
配置php-fpm
cp php.ini-production /data/service/php/etc/php.ini
cp /data/service/php/etc/php-fpm.conf.default /data/service/php/etc/php-fpm.conf
cp /data/service/php/etc/php-fpm.d/www.conf.default /data/service/php/etc/php-fpm.d/www.conf
配置php-fpm服务
# 注意:这个文件是根据上面C++编译配置动态生成的文件,里面写了上面配置的路径
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
# 启动权限
chmod +x /etc/init.d/php-fpm
启动:
# 增加开机启动
systemctl enable php-fpm
systemctl start php-fpm
注意:php-fpm需要nginx用户,当然你可以自行增加,也可以直接安装nginx。
自动化脚本:
https://github.com/easonjim/centos-shell/blob/master/php/install-php_7.1.21.sh
参考:
https://blog.csdn.net/tojohnonly/article/details/78680633
CentOS 7解压安装PHP7.1.21的更多相关文章
- CentOS 7解压安装PHP5.6.13
自动化脚本: https://github.com/easonjim/centos-shell/blob/master/php/install-php_5.6.13.sh
- mysql zip 解压安装
系统:win10 专业版 mysql 5.7.21 解压安装. 对于Windows,mysql官网推荐使用可执行文件进行安装,这里我还是暂时用noinstall 解压zip文件来安装 zip 文件解压 ...
- Windows解压安装mysql 5.7.24,并部署多个mysql服务
mysql官网windows安装文档 https://dev.mysql.com/doc/refman/5.7/en/windows-installation.html 第一步,选择安装包 htt ...
- Linux(CentOS-7) 下载 解压 安装 redis 操作的一些基本命令
使用xshell 连接到虚拟机,并且创建 一个redis目录:创建文件命令:mkdir 文件名ls:查看当前文件里面的所有文件 使用xftp 将下载的linux版本 reids上传动新建的redis目 ...
- debian 8 解压安装mysql(版本5.7.19)
debian 8 解压安装mysql(版本5.7.19)一.下载 根据目标主机的型号官网下载mysql安装包如: mysql-server_5.7.19-1debian8_amd64.deb-bund ...
- 解压安装的tomcat, 使用chkconfig命令让tomcat 随机启动,tomcat 变为系统服务
使用解压安装的tomcat包,命令行输入 service tomcat start 会报 tomcat: unrecognized service 错误提示,意思是说系统没有找到该服务. 好了,我们现 ...
- MySQL v5.7.18 版本解压安装
下载MySQL https://dev.mysql.com/downloads/mysql/5.1.html#downloads 个人机子是64位的,所以选择下载:Windows (x86, 64-b ...
- centos tomcat解压版安装
解压: tar -xzvf apache-tomcat-8.5.23.tar.gz -C /usr/local/java 配置Tomcat的环境变量: export CATALINA_HOME=/us ...
- CentOS直接解压可用的memcached、nginx、keepalived
Centos均基于x86_64版本,下面相关文件编译时使用用户组为www,用户为www 相关命令: groupadd -r www useradd -r -g www -M www memcached ...
随机推荐
- CSS reset--(来自网易)
/* reset */ html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,capti ...
- [转载]嵌入式C语言中的Doxygen注释模板
http://blog.csdn.net/willerency/article/details/7083953 嵌入式C语言开发中通常使用Doxygen进行文档的生成.Doxygen支持多种格式,非常 ...
- CSS-3 Transition 的使用
css的transition允许css的属性值在一定的时间区间内平滑地过渡.这种效果可以在鼠标单击.获得焦点.被点击或对元素任何改变中触发,并圆滑地以动画效果改变CSS的属性值." tran ...
- django错误笔记——1242 Subquery returns more than 1 row
在数据库查询操作过程中,子查询结果不唯一,导致外面的查询无法进行. 我的错误语句: rid = models.User.objects.filter(username=username).values ...
- 第11月第3天 直播 rtmp yuv
1. LiveVideoCoreSDK AudioUnitRender ==> MicSource::inputCallback ==> GenericAudioMixer::pushBu ...
- 树莓派编译安装opencv3 (2019.1.6更新)
一.更新系统 sudo apt-get update sudo apt-get upgrade sudo rpi-update #重启系统 sudo reboot 二.安装依赖库及程序 sudo ap ...
- PHP中冒号、endif、endwhile、endfor使用介绍
我们经常在wordpress一类博客程序的模板里面看到很多奇怪的PHP语法,比如: 复制代码代码如下: <?php if(empty($GET_['a'])): ?> <font c ...
- Android 4.4 API
Android 4.4 (KITKAT) 是新的 Android 平台版本,为用户和应用开发者提供了新功能.本文旨在介绍其中最值得关注的新 API. 作为应用开发者,您应尽快从 SDK 管理器下载 A ...
- MySQL自定义函数和存储过程的区别:
自定义函数和存储过程的区别: 1)一般来说,存储过程实现的功能要复杂一点,而函数的实现的功能针对性比较强.存储过程,功能强大,可以执行包括修改表等一系列数据库操作:用户定义函数不能用于执行一组修改全局 ...
- 【Git使用详解】Egit的常用操作详解
常用操作 操作 说明 Fetch 从远程获取最新版本到本地,不会自动merge Merge 可以把一个分支标签或某个commit的修改合并现在的分支上 Pull 从远程获取最新版本并merge到本地相 ...