LAMP on DigitalOcean upgrade php to php7.0

Linux 31 ส.ค. 2016

Start with add repositories

sudo add-apt-repository ppa:ondrej/php

but if you have some error about UTF-8 fix by

$ locale-gen en_US.UTF-8
$ export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
$ sudo add-apt-repository ppa:ondrej/php

and update apt-get

$ apt-get update && apt-get -y upgrade

Install New PHP Versions

$ sudo apt-get install php7.0

install apache mod package with

$ sudo apt-get install libapache2-mod-php7.0

Now I could run sudo a2dismod php5 for disable php5 and enable php7 with.

$ sudo a2dismod php5 
$ sudo a2enmod php7.0
$ sudo service apache2 restart

test with phpinfo() and end…



Just a middle-aged programmer, Can do many things but not the most.