Php 7 release date was December 3, 2015. This blog explains how to quickly upgrade an Apache web server running PHP 5.x (any release) to PHP 7.
Run the command to install PPA packages first
$ sudo apt-get install python-software-properties
$ sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
Remove PHP 5 and install PHP 7:
$ sudo apt-get update
$ sudo apt-get purge php5-common -y
$ sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y
$ sudo apt-get --purge autoremove -y
Testing PHP:
$ php -v
OUTPUT
Output
PHP 7.0.0-5+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
Open a new file called info.php
$ sudo nano /var/www/html/info.php
info.php
<?php
phpinfo();
?>
Now you may exit the editor, saving info.php
. Now, load the following address in your browser:
http://server_domain_name_or_IP/info.php
All done! PHP 7 has been installed successfully.
Thanks for reading the blog.
0 Comment(s)