How to configure your apache 2 server with php 7

Suppose you have apache 2 server installed in your Ubuntu 14 and it came with php 5*. Now whenever you start apache 2 server typing localhost in your browser, you find that your apache server has not been configured with php 7.1.
Now how you’d solve this nagging problem?
First you need to remove every php version from your machine.

sudo apt-get purge php.*

Next you need to reinstall PHP 7 by these commands one after another:

sudo add-apt-repository ppa:ondrej/php

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php7.1

sudo apt-get install php7.0-mysql

sudo apt install php libapache2-mod-php

sudo apt install php7.0-mbstring

It’s done. Now your apache server has been configured with php latest version.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s