logo
  • Home
  • Blog
  • About
  • Contact
  • Services
Login
Call Us
+91

Cookies Consent

This website use cookies to help you have a superior and more relevant browsing experience on the website. Read more...

logo Login
  • +91
  • inquiries@advantageaieng.com
shape
shape
shape

Blog Details

Home Blog Details
image
  • By Bimlesh Kumar
  • 21 Nov, 2025
  • IT Consultancy

How To Install Apache, MySQL, PHP & Composer On Ubuntu

How To Install Apache, MySQL, PHP & Composer On Ubuntu

Step 1: Installing Apache

To begin, refresh the cache. If this is the first time using sudo in this session, you will have to enter the user’s password in order to continue. This ensures that the user has the necessary privileges to manage the system packages using apt and that they are not being interfered with by other users, please follow step by step:

  • sudo apt update

Then, install Apache with:

  • sudo apt install apache2

Once installed you can open localhost on any browser and have a look at the apache default page.

YXgrYWVRUC8wMlJnVHdFMWNycy9IMnowa2Flb1FDbkRPVUJVSTZRaWRhazF0aFh4VXhyQkVvUlBrVVA5ckJoag==

If you can view this page, your web server is correctly installed and accessible through your firewall.


Step 2: Installing MySQL

  • sudo apt install mysql-server
  • sudo mysql
  • ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
  • exit

Once installed you can type this on terminal and type your password to login: mysql -u root -p


Step 3: Installing PHP

You have Apache installed to serve your content and MySQL to store and manage your data. PHP acts as the processing component, generating dynamic content for users. Along with the PHP package, you’ll need php-mysql, a module that enables PHP to interact with MySQL databases. Additionally, libapache2-mod-php is required to allow Apache to process PHP files. The core PHP packages will be installed automatically as dependencies.

To install these packages, run the following command:

  • sudo apt install php libapache2-mod-php php-mysql

Once the installation is finished, run the following command to confirm your PHP version:

  • php -v

You can also install more than one package at a time. Here are a few suggestions of the most common modules you will most likely want to install:

  • sudo apt-get install -y php8.3-cli php8.3-common php8.3-mysql php8.3-zip php8.3-gd php8.3-mbstring php8.3-curl php8.3-xml php8.3-bcmath


Step 4: Setting Up Composer for Dependency Management

Libraries are reusable collections of code that simplify solving common problems without requiring you to write everything from scratch. With a wide range of libraries available, a dependency manager becomes essential for efficiently handling multiple libraries as you advance in PHP development.

Composer is a PHP dependency management tool that lets you specify the libraries your project requires and handles their installation and updates seamlessly.

To install Composer, download the installer first with the following curl command:

  • curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
  • HASH=`curl -sS https://composer.github.io/installer.sig`
  • echo $HASH
  • php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  • sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer

To test your installation, run:

  • composer

Thanks,

AAI

Tags: Apache MySQL PHP
Share:
Search
Category
  • Database Security (0)
  • IT Consultancy (4)
  • App Development (1)
  • Ubuntu (1)
Resent Post
  • image
    05 Dec, 2025
    Top jQuery Interview Questions and Answers for 2025 Part 3 (Beginner to Advanced)
  • image
    04 Dec, 2025
    Top jQuery Interview Questions and Answers for 2025 Part 2 (Beginner to Advanced)
  • image
    03 Dec, 2025
    Top jQuery Interview Questions and Answers for 2025 (Beginner to Advanced)
Tags
jQuery Interview Learning Development Questions Apache Server Web SSL HTTP Security Ubuntu Optimization MySQL PHP Composer Linux DevOps EngineeringExcellence SaaS Developers AAI
shape
shape
shape
shape
shodow
image

Advantage AI Engineering Private Limited

Our Services

  • IT Management
  • Cybersecurity & Data Protection
  • IT Consultancy
  • App Development
  • Cloud & DevOps Services

Quick Link

  • FAQ
  • Home
  • Blog
  • About
  • Contact

Contact Us

A-130, Sector-63, Noida, UP-201301

  • Opening Hours:

    Mon - Fri: 11.00 AM - 5.00 AM

  • Phone Call:

    +91

© All Copyright 2025 by Advantage Ai Engineering Private Limited

  • Terms & Conditions
  • Privacy Policy