Installing Apache, MySQL, and PHP on Ubuntu 16.04/18.04

Frame 1321317395

By

Frame 1321317395 (2)

5 Minutes Read

When we install LAMP Stack on Linux machines especially on Ubuntu 16.04/18.04, you have to read many blogs/articles to get the required information. To get rid of this hurdle, I’ve written this article to explain each and everything at one place to install the LAMP stack on Linux Machine.

Note: In order to run commands to install LAMP stack you need root access of server.

Step 1: Update your package manager

    
     console.log( 'Code is Poetry' );
    
   

Step2: Install Apache Web server

Install Apache Web server
    
     $ sudo apt-get install apache2

    
   
Run below commands to manage web server

Start the Apache server:

    
     $ sudo service apache2 start

    
   

Stop the Apache server:

    
     $ sudo service apache2 stop

    
   

Restart the Apache server:

    
     $ sudo service apache2 restart

    
   

To check status of the Apache server:

    
     $ sudo service apache2 status
Sample Output
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Tue 2018-04-23 14:28:43 EDT; 45s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 13581 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 13605 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
    Tasks: 6 (limit: 512)
   CGroup: /system.slice/apache2.service
           ├─13623 /usr/sbin/apache2 -k start
           ├─13626 /usr/sbin/apache2 -k start
           ├─13627 /usr/sbin/apache2 -k start
           ├─13628 /usr/sbin/apache2 -k start
           ├─13629 /usr/sbin/apache2 -k start
           └─13630 /usr/sbin/apache2 -k start
    
   
You can do a spot check right away to verify that everything went as planned by visiting your server’s public IP address in your web browser
    
     http://localhost
http://127.0.0.1
http://your_server_ip
    
   
Small Apache

Step3: Installing Mysql

My Sql
    
     $ sudo apt-get install mysql-server

    
   

Testing your MySQL installation:
Run below command to check MySQL is successfully configured

    
     $ sudo mysql -u root -p

    
   
Run below commands to manage your MySQL server

Start the MySQL server:

    
     $ sudo mysql -u root -p

    
   

Stop the MySQL server:

    
     $ sudo service mysql stop

    
   

Restart the MySQL server:

    
     $ sudo service mysql restart

    
   

To check status of the MySQL server:

    
     $ sudo service mysql status

    
   

Step4: Installing PHP

Php
To install the latest version of PHP run below command on your terminal
    
     $ sudo apt-get install php

    
   

Install common PHP modules like bcmath, bz2, intl, gd, mbstring, zip.
Run following commands to install

    
     $ sudo apt-get install php-bcmath
$ sudo apt-get install php-bz2
$ sudo apt-get install php-intl
$ sudo apt-get install php-gd
$ sudo apt-get install php-mbstring
$ sudo apt-get install php-zip
    
   

To check the PHP version through console, please run below command

    
     $ php -v

    
   

Conclusion

This article will help people to install LAMP stack on Linux machine especially Ubuntu 16.04/18.04 without spending too much time reading many blogs/articles.

If you have suggestions or any question please mention in comment.

For business owners, finding andand choosing the right e-commerce platform for business takes effort. You will need an expert who can understand your business vision and goal giving your customers a smooth experience. We have some of the best platforms to choose from. Let’s read and decide which is better and capable of helping your business scalability.

Shopify: Manage Every Part of your E-Commerce Business

With Shopify, you can get some features and a simple user interface. It is suitable for businesses of all sizes, providing a wide range of custom templates and a strong app environment. Shopify supervises everything from payments to safe transactions and shipping, making it a considerable choice for those who want their e-commerce store to grow efficiently.

BigCommerce: Take your Business to New Heights

Scale up your business with BigCommerce. BigCommerce is built for growth and ensures your platform matches your business goals. With innovative SEO-friendly features, a variety of secure payment options, and a custom experience, BigCommerce is best for businesses ready to grow without limits. BigCommerce is just like having a partner who’s always there to help you reach your next goal, making sure you’re not just staying ahead but leading the way.

WooCommerce: The Power of WordPress, Specially Made for you

If you are a WordPress proficient, you know that WooCommerce is just a piece of cake. It’s a software solution that lets you upgrade your WordPress site into a custom-made fully functional eCommerce store. With the many options of plugins and custom themes, WooCommerce gives a range of customization options, making it suitable for businesses that want to take charge of how their online store appears and functions.

Squarespace: Where Design is Parallel to Functionality

Squarespace is preferred for its attractive design templates and easy-to-use interface. It’s recommended for businesses that want a visually appealing beautifully designed online store. Squarespace combines beautiful design with advanced eCommerce features, from inventory to checkout, making it an appropriate choice for innovative businesses.

Magento: The Customization Solution

Magento is an advanced platform specially designed for businesses needing customization and scalability. It is an advanced solution that can handle many products and checkouts, making it an ideal choice for larger businesses. Magento gives you the flexibility to create a different and customized shopping experience without requiring technical experience to manage efficiently.

Your E-Commerce Success Starts Here

The eCommerce solution made just for you and that helps you achieve your business goal is very important to provide business scalability. It’s about finding the one e-commerce partner that not only helps your business grow but also encourages future scalability. From a simple design interface to scalability, there’s a solution that’s just the best fit for your business.

Remember, making the right choice will give a smooth ecommerce experience that brings your customers back for more. With the right choice of platform, you can efficiently manage your business and make it successful. What are you waiting for? Get it started today.

Contact Us:
0731 496 7837
info@encoresky.com

Related Articles

Master Your React

Master Your React Debugging with React Developer Tools

In the dynamic world of React development, efficiency and clarity are everything. React Developer Tools (React DevTools) helps the React developers to debug, analyze, and optimize their applications without trouble.This tool…

E-Commerce

Drive More Sales With Video E-commerce

Imagine a world where e-commerce video shopping is not just a transaction but an experience. In video e-commerce, every click is an experience. As the number of mobile users has increased…

E-Commerce

Find Your E-Commerce Partner in Success

For business owners, finding andand choosing the right e-commerce platform for business takes effort. You will need an expert who can understand your business vision and goal giving your customers a smooth experience. We have…