服务器ecs上本来跑了一套nginx+php5.5,由于新项目使用的是laravel5.4,所以不得不把php升级,在此记录下在此安装的过程和遇到的问题,总体来说还算顺利

cd /usr/local/src

切换到自己的安装目录,我下载的是http://php.net/get/php-7.1.4.tar.xz/from/a/mirror,php-7.1.4.tar.gz

tar zxvf php-7.1..tar.gz  #解压后
cd php-7.1./ #切换到解压目录

接着编译:

./configure --prefix=/usr/local/php7 \
--with-curl \
--with-freetype-dir \--with-gettext \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir \
--with-mysqli \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-pear \
--with-png-dir \
--with-xmlrpc \
--with-xsl \
--with-zlib \
--with-png-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-gd \
--enable-fpm \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-gd-native-ttf \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-xml \
--enable-zip

如果配置错误,需要安装需要的模块

sudo apt-get install -y autoconf libtool re2c libxml2-dev openssl libcurl4-openssl-dev libbz2-dev libjpeg-dev libpng12-dev libfreetype6-dev libldap2-dev libmcrypt-dev libmysqlclient-dev libxslt1-dev libxt-dev libpcre3-dev libxpm-dev libt1-dev libgmp-dev libpspell-dev librecode-dev libreadline6-dev bison libtidy-dev

如果出错重新编译即可.编译完成后:

##根据Wrote PEAR system config file at: /usr/local/php7/etc/pear.conf
##You may want to add: /usr/local/php7/lib/php to your php.ini include_path
##这个信息,我们需要在当前 php7目录下执行
cp php.ini-development /usr/local/php7/lib/php.ini (下面会有介绍)
到至,php7-fpm安装成功

接着复制备份文件:

cp php.ini-development /usr/local/php7/lib/php.ini
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp -R /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php7-fpm.d/www.conf
cp -R ./sapi/fpm/php-fpm /etc/init.d/php7-fpm

启动php:

/etc/init.d/php7-fpm

出现

因为启动用户的默认用户组为nobody,我们加个用户组

groupadd nobody

OK,php7-fpm启动成功
顺便配置下nginx搭配php7
我滴配置如下:

server {
listen ;
server_name localhost xxxxxx.com ; location / {
root /home/www/test;
index index.html index.htm index.php;
#try_files $uri $uri/ /index.php?$query_string;
} location ~ \.php$ {
root /home/www/test;
fastcgi_pass 127.0.0.1:; #这里是重点额
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} }
检测下配置是否正确:
/usr/sbin/nginx -t
如果没错后执行:
service nginx reload

最终运行结果:

补充:上面如果编译GD库失败:可以执行:sudo apt-get install php7.1-gd

ubutun 安装php7.1x的更多相关文章

  1. CentOS 7.1编译安装PHP7

    原文: https://typecodes.com/web/centos7compilephp7.html?utm_source=tuicool&utm_medium=referral 1 创 ...

  2. 编译安装PHP7并安装Redis扩展Swoole扩展

    编译安装PHP7并安装Redis扩展Swoole扩展 在编译php7的机器上已经有编译安装过php5.3以上的版本,从而依赖库都有了 本php7是编译成fpm-php 使用的, 如果是apache那么 ...

  3. centos 7.2 安装PHP7.1+apache2.4.23

    安装准备:   http://ftp.cuhk.edu.hk/pub/packages/apache.org//httpd/httpd-2.4.23.tar.gz 下载apache http://cn ...

  4. 【安装PHP】如何在openSUSE42.1下编译安装PHP7

    首先推荐一篇文章PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog. 里面说到是否会去使用PHP7, ...

  5. centos6.4下安装php7+nginx+mariadb环境

    一,安装php71,创建php用户和用户组,并在github下载php7源码#新建php用户和php组# groupadd -r php && useradd -r -g php -s ...

  6. 搭建LNAMP环境(四)- 源码安装PHP7

    上一篇:搭建LNAMP环境(三)- 源码安装Apache2.4 一.安装PHP7 1.yum安装编译php需要的包 yum -y install libxml2 libxml2-devel curl- ...

  7. WINDOWS和Linux上安装php7 alpha 并安装 yaf

    WINDOWS和Linux上安装php7 alpha 并安装 yaf PHP技术  widuu  2个月前 (06-15)  126浏览  0评论 windows 1.windows上安装 php7 ...

  8. Centos 7 通过YUM安装 PHP7 NGINX1.1.8 POSTGRESQL9.5

    转载 1.最小化安装CENTOS7 2.更新源: yum update reboot 3.安装扩展源: yum install epel-release 4.安装工具软件: yum install w ...

  9. HomeBrew 安装 PHP7.1(开发笔记)

    HomeBrew 安装 PHP7.1 $ brew update $ brew tap homebrew/dupes $ brew tap homebrew/php $ brew update $ b ...

随机推荐

  1. 1711: [Usaco2007 Open]Dingin吃饭

    1711: [Usaco2007 Open]Dingin吃饭 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 560  Solved: 290[Submit ...

  2. AVFoundation自定义录制视频

    #import <AVFoundation/AVFoundation.h> #import <AssetsLibrary/AssetsLibrary.h> @interface ...

  3. MySQL基准测试(benchmark)

    基准测试是唯一方便有效的.可以学习系统在给定的工作负载下会发生什么的方法.基准测试可以观察系统在不同压力下的行为,评估系统的容量,掌握哪些是重要的变化,或者观察系统如何处理不同的数据. 验证基于系统的 ...

  4. jQuery中$.extend(true,object1, object2);深拷贝对象

    语法:jQuery.extend( [deep ], target, object1 [, objectN ] ) 深浅拷贝对应的参数就是[deep],是可选的,为true或false.默认情况是fa ...

  5. 关于数组和集合的冒泡排序中容易出现的IndexOutOfBoundsException

    数组只能存错一种相同的数据类型,集合只能存储引用数据类型(用泛型),集合的底层就是一个可变的数组. 数组的冒泡排序: public static void arrayMaxPaiXu(int[] ar ...

  6. 对于自定义标签类中JspBody类的invoke方法的理解

    下面是javaeeAPI中对于invoke()方法的介绍: 其中的参数out是一个Writer类的对象,如果写null,就是将标签体内容写到了与此jsp相关联的JspWriter对象,也就是下面的w: ...

  7. WebService返回数据前台获取并处理JSON的相关问题

    起因: 记录这个问题的起因是一次解答网友的问题,当初自己初次接触webservice时也遇到过,但在写答案时,并没有很深的印象,只是知道webservice在后台返回值的时候,那里是有个坑的.网友问的 ...

  8. window7使用svn(svn系列 客户端 知识二总结)

     ♣eclipse插件subclipse  ♣TortoiseSVN  ♣svn操作  ♣注意事项 使用svn可以在eclipse直接装subclipse或者在windows使用TortoiseSVN ...

  9. poptest分享计划以及提供的服务

    poptest分享计划以及提供的服务 POPTEST致力于测试开发工程师的培养,能让学员经过系统培训后从事自动化测试工作,包括功能自动化.性能自动化.接口自动化以及移动端系统的自动化测试等,由于移动端 ...

  10. 微信小程序首页总结

      效果图如下 首先从大的方面来讲,就是设置了window的属性 "navigationBarBackgroundColor": "#AFE2E6",//bar ...