How to Install PHP 7.0,Apache2,MySql 5.6 ,PhpMyAdmin on Ubuntu 16.04 - TrueInfoTech - computer,internet technology trick


Tuesday, 21 February 2017

How to Install PHP 7.0,Apache2,MySql 5.6 ,PhpMyAdmin on Ubuntu 16.04

The latest version of PHP 7.0 released with many lots of features who help in speed optimization and securities .i am also using this latest version of PHP or PHP dvelopment execute my websites. This tutorial will help you to install PHP 7.0, apache 2, MySQL 5.6, PHPMyAdmin .if you are using digital ocean droplet then this will surely help you to configure your VPS with the latest version.

How to Install PHP 7.0,Apache2,MySql 5.6 ,PhpMyAdmin

How to install PHP 7.0

First, you need to install python-software-properties package on your server.this will help to your system provides add-apt-repository command .after then you need to run that set of command on ubuntu 16.0 to install PHP 7.0.

 apt-get install python-software-properties
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install -y php7.0

How to Install Apache2

After successfully install your PHP 7.0 we need to install apache 2 for executing our PHP file.because apache is the server who execute PHP file on browser.for install apache2 just run these common on the terminal

 add-apt-repository ppa:ondrej/apache2
apt-get update
apt-get install apache2

how to Install MySQL 5.6

now your PHP 7.0 and apache2 installed .now you need a database for your site .mysql is database now we need to install with the help of this command just run this command on the terminal.
$ sudo add-apt-repository -y ppa:ondrej/mysql-5.6
$ sudo apt-get update
$ sudo apt-get install mysql-server-5.6

Install PHP modules

after installing PHP 7.0 and apache2, phpMySQL 5.0 you will need some modules PHP and apache for apache library based on your application requirement .just run this command

apt-cache search php7-*

apt-get install libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json

Verify Setup

finally, your PHP apache MySQL is installed now if you want to verify your setup just go in /var/www/html/ folder and make an index.php file and paste this PHP info code and save and run on the browser.
Now browse this file in web browser. It will so all the details about version’s and installation.

Install phpMyAdmin

now we need PHPMyAdmin GUI for beginner handle our database and table .to start we can simple install PHPMyAdmin with the help of these command like as we did before just run this command.
apt-get update
apt-get install phpmyadmin php7.0-mbstring php7.0-gettext

now the only thing we need to do is explicitly enable the PHP mcrypt and mbstring extensions, which we can do by typing:
 phpenmod mcrypt

phpenmod mbstring

you'll need to restart Apache for your changes to be recognized:

systemctl restart apache2

You can now access the web interface by visiting your server's domain name or public IP address followed by /phpmyadmin https://domain_name_or_IP/phpmyadmin

Configure Apache to Allow .htaccess Overrides

we need to enable the use of file.htaccess a directive overrides by editing our Apache configuration file.We will edit the linked file that has been placed in our Apache configuration directory:

nano /etc/apache2/conf-available/phpmyadmin.conf

We a directiveAllowOverride All within the <Directory /usr/share/phpmyadmin>section of the configuration file.
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All

now you have restart your apache server with these commond

service apache2 restart

now your phpmyadmin also instlled with .htaccess .

if you like this post please share and like thanks.

No comments:

Post a Comment