各个环境下安装php7.1

以下是有关如何在多个不同操作系统上安装PHP 7.1的简要指南:

Ubuntu 14.04 – 16.10:

PHP 7.1 用   PPA 的方式安装:

1
2
3
4
5
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1
//如果需要fpm的话
sudo apt-get install php7.1-fpm

所有可用的包

Debian 8 (Jessie)

Ondřej Surý also provides PHP 7.1 packages for Debian 用以下命令安装:

1
2
3
4
5
apt-get install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update
apt-get install php7.1

Debian 7 (Wheezy)

debian Wheezy上7可以根据这个文档源码安装: Install PHP 7 on Debian Wheezy.

 

CentOS / RHEL 7.2 & 7.3

Webstatic Yum存储库还没有PHP 7.1 GA软件包,所以我们可以使用Remi的RPM存储库

首先,您需要确保EPEL存储库已配置(并为RHEL启用可选通道):
1
2
3
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

# For RHEL, run this command as well:
subscription-manager repos –enable=rhel-7-server-optional-rpms

接下来我们启用remi-php71存储库:

1
2
yum install yum-utils
yum-config-manager --enable remi-php71

安装 PHP 7.1:

1
yum install php71

CentOS / RHEL 6.8

同上

1
2
3
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm

# For RHEL, run this command as well:
rhn-channel –add –channel=rhel-$(uname -i)-server-optional-6

接下来我们启用remi-php71存储库:

1
2
yum install yum-utils
yum-config-manager --enable remi-php71

安装 PHP 7.1:

1
yum install php71

Mac OS X 10.6 – 10.12

PHP 7.1 可以通过 homebrew的方式:

1
2
3
4
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php71

Or you can install it via Liip’s php-osx tool:

1
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.1

Windows

PHP 7.1 distributions for Windows can be found on the windows.php.net website: http://windows.php.net/download#php-7.1

You can find instructions for installing the distribution here: https://www.webtechgadgetry.com/install-php-7-windows/

原文地址:https://www.colinodell.com/blog/2016-12/installing-php-7-1

发表评论

电子邮件地址不会被公开。 必填项已用*标注