Ubuntu14.04下使用PPA安装php5.6,php7

1.为了使用ppa(Personal Package Archives) 选安装依赖:
# apt-get install python-software-properties

2.添加不同版本php

# add-apt-repository ppa:ondrej/php

如提示:Please check that the PPA name or format is correct 可选择重新安装本地证书:

# apt-get install --reinstall ca-certificates

3.1 安装选择的php5.6版本

# apt-get update
# apt-get install -y php5.6

3.2 安装选择的php7.0版本

# apt-get update
# apt-get install -y php7.0

4.升级安装成功后 查看php cli模式 版本

5.查看php扩展模块 并选择安装

# apt-cache search php7.0*
# apt-get install
 apt-get install php7.0-cli php7.0-fpm php7.0-gd php7.0-json php7.0-mysql php7.0-readline php7.0-bcmath 
php7.0-mcrypt

6.修改nginx与php通信方式【http://blog.csdn.net/koastal/article/details/52303316】

  当前nginx配置通信方式为unix socket:

  php7.0的php-fpm.sock可见:

# vim  /etc/php/7.0/fpm/pool.d/www.conf 

  

     将php7.0的php-fpm更新到nginx配置中:

# vim  /etc/nginx/sites-available/default

      

7.查看cgi模式版本 phpinfo()

8.停止php5的服务

# /etc/init.d/php5-fpm stop

9.php5.5 与 php7.0压测情况

php5.5

 php7.0

  

原文地址:https://www.cnblogs.com/justphp/p/6682525.html