Install LAMP PHP 5.6 Ubuntu
Hi! The Tutorial shows you Step-by-Step How to Install LAMP with PHP 5.6 in Ubuntu-Based GNU/Linux Systems.
And to achieve this Ubuntu LAMP PHP 5.6 Installation you have first to Setup the needed PPA Repository.
Moreover, this LAMP Setup is valid for All the Last LTS Release like: 14.04, 16.04, and 18.04.
Finally, the LAMP Stack is de facto Web Development Standard. Today, the products that make up the LAMP stack are included by default in nearly all GNU/Linux distributions.
-
First, Open a Shell Session
Or Login into Server Shell
Ctrl+Alt+t on Ubuntu desktop.(Press “Enter” to Execute Commands)
In case first see: Terminal QuickStart Guide.
-
How to Install PHP 5.6 on Ubuntu GNU/Linux
-
Then to Install Complete LAMP Stack.
sudo apt install apache2 mysql-server php5.6-mysql
If Got “User is Not in Sudoers file” then see: How to Enable sudo
-
And for Installing the PHP 5.6 Apache Module.
sudo apt install libapache2-mod-php5.6
Please note that this package ONLY works with Apache’s prefork MPM, as it is not compiled thread-safe.
-
Finally, to Test LAMP WebServer Installation
Access the Server document’s location:cd /var/www/html
Create a PHP Info file:
sudo nano info.php
If Got “User is Not in Sudoers file” then see: How to Enable sudo
And Append:<?php phpinfo(); ?>
Ctrl+x to Save & Exit from nano Editor ;)
Set the www-data as User and Group:sudo chown www-data:www-data info.php
Then Open on Browser the URL:
http://localhost/info.php
In case Replace “localhost” with your Server IP in the above URL.
You should Successfully see the PHP Info notice similar to here above :)
How to Enable Apache2 mod_rewrite Module on Ubuntu.
How to Create an Apache 2 Virtual Host on Ubuntu.