How to install PHP 7.1.6 on Ubuntu 17.04 .

To install PHP 7.1.6 on Ubuntu 17.04.

PHP 7.1.6 is the most recent stable release, and is a popular general-purpose scripting language mostly used for the web development. Since it is fast, flexible and pragmatic, PHP is capable of powering everything from your blog to the most popular websites in the world.

Installing PHP

Before you begin with the installation of PHP, make sure you add the necessary repository in your machine. Execute the action by running the following command.

root@linuxhelp:~#  add-apt-repository ppa:ondrej/php
 Co-installable PHP versions: PHP 5.6, PHP 7.0, PHP 7.1 and most requested extensions are included.
PLEASE DON' T USE PHP 5.4 OR PHP 5.5. The PHP 5.5 and later are no longer supported with security updates, therefore they are not included in this repository.
You can get more information about the packages at https://deb.sury.org
BUGS& FEATURES: This PPA now has a issue tracker: https://deb.sury.org/#bug-reporting
.
.
gpg: Total number processed: 1
gpg:               imported: 1
OK

Once it is done, update the newly added repo as follows.

root@linuxhelp:~# apt-get update
Hit:1 http://ppa.launchpad.net/gns3/ppa/ubuntu zesty InRelease                 
Hit:2 http://in.archive.ubuntu.com/ubuntu zesty InRelease                      
Get:3 http://security.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]     
.
.
Fetched 379 kB in 2s (128 kB/s)     
Reading package lists... Done

Now is the time to install PHP 7.1.6. in your machine. Run the following command for kick-starting PHP installation.

root@linuxhelp:~# apt-get install php7.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
Processing triggers for libc-bin (2.24-9ubuntu2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (232-21ubuntu2) ...
Processing triggers for ufw (0.35-4) ...

PHP 7.1.6. is installed in your system. To check , run the the following command.

root@linuxhelp:~# php -v
PHP 7.1.8-2+ubuntu17.04.1+deb.sury.org+4 (cli) (built: Aug  4 2017 13:07:41) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.8-2+ubuntu17.04.1+deb.sury.org+4, Copyright (c) 1999-2017, by Zend Technologies

With the above step, the complete installation and verification of PHP 7.1.6. is complete.

Tag : Php
FAQ
Q
What is the difference between mysql_fetch_object and mysql_fetch_array?
A
mysql_fetch_object() is similar tomysql_fetch_array(), with one difference -
an object is returned, instead of an array. Indirectly, that means that
you can only access the data by the field names, and not by their
offsets (numbers are illegal property names).
Q
how many ways we can retrieve the data in the result set of MySQL using PHP?
A
You can do it by 4 Ways
1. mysql_fetch_row.
2. mysql_fetch_array
3. mysql_fetch_object
4. mysql_fetch_asso
Q
Functions in IMAP, POP3 AND LDAP?
A
You can find these specific information in PHP Manual.
Q
How can we encrypt and decrypt a data present in a MySQL table using MySQL?
A
Run the following command,
AES_ENCRYPT () and AES_DECRYPT ()
Q
Suppose your Zend engine supports the mode Then how can u configure your PHP Zend engine to support mode ?
A
In php.ini file:
set
short_open_tag=on
to make PHP support