Ubuntu 14.04上安装php7.0并配置apache2

sudo a2dismod php5
sudo add-apt-repository ppa:ondrej/apache2
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0
# 看情况选择
#sudo apt-get install php7.0-cli php7.0-common  php7.0-curl php7.0-gd php7.0-mysql php7.0-curl php7.0-xml php7.0-memcache php7.0-memcached php7.0-intl php7.0-mongo php7.0-mongodb php7.0-mbstring
sudo apt-get install libapache2-mod-php7.0
sudo a2enmod php7.0
sudo service apache2 restart

Note: If your system’s locale is set to anything other than UTF-8, adding the PPA may fail due to a bug handling characters in the author’s name. As a workaround, you can install language-pack-en-base to make sure that locales are generated, and override system-wide locale settings while adding the PPA:

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php

如果遇到Apache环境变量问题,可以执行

source /etc/apache2/envvars

PPA for Apache 2.x
How To Upgrade to PHP 7 on Ubuntu 14.04
The main PPA for PHP (5.6, 7.0, 7.1) with many PECL extensions

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值