LAMP stands for Linux with Apache, Mysql and PHP. In this article we are going to see how to install a LAMP stack in Debian based machines Ubuntu-17.04. We are going to install all these packages through source installation which allows us to install required versions.
Installing Apache:
On my previous articles i showed how to run a customized apache through source installation. Click here if you miss the article for installing Apache.
Installing Mysql:
On Ubuntu machine we are going to install the default mysql through apt.
$ apt-get install mysql-server
$ systemctl start mysql
Installing PHP:
As already told we are configuring applications through source installations.
Downloading the source package,
Download the package from PHP official site. Click here to go to the downloads page. This page has the latest stable version for PHP.
For older versions Click here.
The above command configures PHP with the given apache server path with necessary modules to run a LAMP stack.
For more modules you can refer the below the command
Now you have configured PHP with your Apache server.
To test the LAMP stack create a PHP info file in the Document root,
$ vim /usr/local/apache-2.4.37/htdocs/info.php
Enter the below contents in the file,
<?php
phpinfo();
?>
Start the apache process after testing the configuration,
$ /usr/local/apache-2.4.37/bin/apachectl -t
$ /usr/local/apache-2.4.37/bin/apachectl start
Now enter the IP address or 127.0.0.1(If you installed in your local system) on the browser like,
IP_address/info.php or 127.0.0.1/info.php
If your installation is successful you will be able to view the PHP informations on your browser.
Feel free to ask if you have any questions on the comment box.
Comments