安装PHP7.0
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.0
sudo apt-get install
php7.0
php7.0-dev
php7.0-mysql
php7.0-curl
php7.0-cli
php7.0-common
php7.0-curl
php7.0-fpm
php7.0-gd
php7.0-intl
php7.0-json
php7.0-memcached
php7.0-mysqlnd
php7.0-readline
php7.0-zip
已经安装过得PHP升级到php7.0
sudo add-apt-repository ppa:ondrej/php
注:
如果提示:sudo: add-apt-repository: command not found 执行:
sudo apt-get install software-properties-common
更新所有程序
sudo apt-get update
删除之前PHP5 的扩展
sudo apt-get purge php5-*
安装所有更新后的数据
sudo apt-get upgrade
安装PHP7 以及之前删除的扩展
sudo
apt-get install
php7.0
php7.0-dev
php7.0-mysql
php7.0-curl
php7.0-cli
php7.0-common
php7.0-curl
php7.0-fpm
php7.0-gd
php7.0-intl
php7.0-json
php7.0-memcached
php7.0-mysqlnd
php7.0-readline
php7.0-zip
配置/etc/php7/cli/php.ini中设置时区
date.timezone = Asia/Shanghai
安装apcu,apcu_bc 扩展
sudo apt-get install php-apcu php-apcu-bc
当上述命令无法安装时,需要手动下载安装包,自行安装:
php.ini 配置 apcu
打开 /etc/php/7.0/mods-available/apcu.ini
添加代码:
apc.enable_cli=On