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

来源:互联网 发布:斯托克斯公式矩阵 编辑:程序博客网 时间:2024/05/16 05:58
sudo a2dismod php5sudo add-apt-repository ppa:ondrej/apache2sudo add-apt-repository ppa:ondrej/phpsudo apt-get updatesudo 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-intl php7.0-mongo php7.0-mongodbsudo apt-get install libapache2-mod-php7.0sudo a2enmod php7.0sudo 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-basesudo 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

0 0
原创粉丝点击