How to Install PHP8.3 and MySQL 8.0 on Ubuntu 22.04 in Microsoft Azure using NGINX/Apache Server?

8 minutes
Author Image By Tech Team

Last Updated: May 17, 2024

8 minutes

This blog tutorial will assist you in understanding the installation concept of PHP8.3 and MySQL 8.0 on Ubuntu 22.04 using the NGINX server on Microsoft Azure.

Here, we’ll go over all the requirements and other information you need to install PHP 8.3 and MySQL 8.0 on Ubuntu 22.04 on Microsoft Azure using the NGINX Server.

Furthermore, we will comprehend the distinction between utilizing PHP in FPM as opposed to PHP alone, as well as the advantages of NGINX over Apache.

So, move your eyeball with the content and implement the procedure gradually to drive smoothen installation. Let’s Begin!

What is a VM (Virtual Machine) and Why do you need it?

Establishing a VM (Virtual Machine) is a prerequisite for installing PHP 8.3 and MySQL 8.0 on Ubuntu 22.04 on Microsoft Azure with NGINX Server. Let me tell you about the virtual machine (VM) and how it operates for now.

What it is —- A virtual machine (VM) is a software emulation made up of a physical computer that enables you to run on a single physical machine on multiple operating systems. A VM (Virtual Machine) will assist you in offering a virtualized environment for deploying and managing software components independently like installing PHP 8.3 and MySQL 8.0 on Ubuntu 22.04 in Microsoft Azure using an NGINX server.

How will it assist you —- Creating a virtual machine (VM) is essential to set up PHP 8.3, MySQL 8.0, and NGINX on Ubuntu 22.04 in Microsoft Azure since it offers a dedicated, isolated, flexible, scalable, secure, manageable, and compatible environment for cloud services like the mention components.

The VM allows for customization, and efficient resource allocation and makes the PHP 8.3 installation process easier to manage and maintain in secure environments. Virtual Machine creation ensures that PHP 8.3 and MySQL 8.0 run smoothly on Ubuntu 22.04 while working with the NGINX web server.

How to Establish a VM? | Prerequisites for Installing PHP 8.3

In order to install PHP8.3 and MySQL 8.0 on Ubuntu 22.04 in Microsoft Azure using NGINX Server, you must first follow the instructions below to easily establish a virtual machine (VM).

First, go to home page and click on “Create a Resource” (+ icon) from Azure Services.

Next, you have to choose Ubuntu 22.04 and have to click on the —- “Start button” among all three available options.

Click on the —- “Start Free” button and execute your signing-in procedure. Once, it’s done, then it’ll ask you to follow the payment processing details, so fill out them.

Once, it’s done, you’ll come to the “Create a Virtual Machine” option.

Here the “Create your Virtual Machine (VM)” procedure will open to you.

So, you need to choose the details like Machine name, availability, security type, image, public ports, Ubuntu version, and size of the machine with their respective pricing. Plus, user name, license, key pair name, inbound ports, etc, and finally click on the —- “Next: Disk” option.

Once, you have clicked on the —- Next: disk button, then you have to choose the requirements like OS disk size, disk type, key management, and so on. Consequently, click on the —- “Create and attach a new disk” option.

Under the “Create and attach new disk” option, choose the details like your new disk name, source type, size, and key management, and choose your disk size as well. For this, Click on the —- size option.

From here, you have to select the ideal size for your disk along with the performance tier, provisioned IOPS, provisioned throughput, Max share, Max burst IOPS, custom disk name, and more. As a consequence, have to click on the —- Ok button.

After reviewing your entire details and making the required changes, click on the —- “Review + Create button”.

Here, your Virtual Machine (VM) has been created. Once, you have created your VM, then you are ready to install PHP 8.3 and operate it for further usage.

How To Install PHP 8.3? | A stepwise Installation Guide

Following are the commands that you can use to install PHP 8.3.

add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.3-fpm php8.3-mysql php8.3-common php8.3-cli
sudo systemctl restart apache2

MySQL Installation guide in step-by-step format

Using the below command, you will be able to install MySQL smoothly.

sudo apt update
sudo apt install mysql-server
sudo systemctl restart mysql

How To Install NGINX Server? | Step-by-step instructions for installation

This command will assist you in installing the NGINX Server. So, go smoothly

sudo apt update
sudo apt install nginx
sudo systemctl restart nginx

How To Install Apache Server? | A stepwise Installation Guide

The below command will help you to install Apache Server.

sudo apt update
sudo apt install apache2 -y
sudo systemctl restart apache2 -y

Official Source:

In What Ways PHP in FPM is Beneficial? Why FPM is Essential?

Before counting on the benefits of PHP in FPM, let me introduce you to the concept of (FPM) FastCGI (Common Gateway Interface) Processing Manager and role.

What is FPM?

FPM is the abbreviation for FastCGI (Common Gateway Interface) Process Manager. The implementation of FastCGI (Common Gateway Interface) Process Manager assists you in managing and controlling PHP processes by serving as an additional feature of PHP.

FPM has been designed to improve the performance and scalability of PHP-based web applications by efficiently handling PHP requests.

The Role of PHP in FPM

PHP in FPM serves as the scripting language engine that processes the PHP code in response to web requests. FPM acts as a manager for PHP processes that handle tasks such as process creation, management, and termination based on the incoming workload. FPM offers a collection of PHP workers that helps in handling multiple concurrent requests, optimizing resource utilization, and response times.

Benefits of Using PHP in FPM

Performance Optimization:

FPM optimizes PHP performance by offering a pool of PHP processes that helps to reduce the overhead of process creation and termination compared to traditional CGI-based PHP setups.


FPM provides a configuration of multiple PHP process pools that enables horizontal scalability whereas each PHP process serves a specific set of requests. Which is very crucial for handling varying traffic loads effectively.

Resource Management:

FPM also provides control over PHP process resources, such as memory usage, enhancing stability, execution time limits, and preventing resource exhaustion.

Process Isolation:

As we’ve mentioned, it offers FPM offers multiple PHP processes whereas each PHP process operates independently to ensure better isolation and security between different requests and also to reduce the risk of one request impacting others.

Fault Tolerance:

FPM includes features that aid in managing process failures, automatic restarts, and improving the overall reliability of PHP applications.

Why Should You Use PHP in FPM instead of using PHP Only?

Using PHP without FPM is just like (using Apache’s mod_php or CGI-based PHP), PHP in FPM offers better performance, scalability, better processing, and resource management compared to using only PHP.

FPM optimizes PHP process handling, enhances isolation, and allows for finer control over PHP resources that lead to more efficient and reliable web applications.

What Does Nginx Offer that Apache Doesn’t?

Nginx and Apache

The Nginx server is continuously emerging because of its incredible & innovative features, as well as developers, are perpetuating to use of Nginx instead of working on Apache.

Hence, let’s do a quick comparison between both servers and understand which one is better for you or how Nginx is better than Apache.

NGINX ServerApache Server
Supports HTTP/3:

NGINX Offers modern web application functionality as it supports to latest HTTP/3 protocol that helps to improve performance, reduces latency, and enriches gross security.
Supports HTTP/2:

Apache offers HTTP/2 protocol which provides very high performance compared to HTTP/1.1. So, you don’t need to be concerned about better performance & efficiency offers.
Offer Reverse Proxy Natively:

Within the reverse Proxy feature, NGINX maintains the incoming traffic and distributes it efficiently to backend servers including legacy systems and microservices.
Reverse Proxy with additional Module:

Apache also offers a reverse proxy feature for which it uses the modules like mod_proxy, mod_proxy_http, and mod_proxy_balancer.
Solves C10K Problem:

Using NGINX single server, you are allowed to handle 10,000 clients simultaneously without blocking the I/O architecture of the server since it optimizes network sockets.
Solves C10K Problem with MPM:

Apache server can also address the C10k problem using its event-driven MPM (Multi-Processing Module) called event.
Supports All Containerization Platforms:

NGINX seamlessly integrates with containerization platforms like Docker Swarm, Kubernetes, OpenShift, etc to provide scalable & reliable application delivery within containerized environments.
Support limited Containerization Platforms:

Apache servers can support containerization platforms like Docker Swarm, Kubernetes, and OpenShift, but Apache does not have any native support.
Low Memory Usage while High Concurrency:

NGINX is known for its ability to use minimal system resources while handling a large number of concurrent connections efficiently. This makes it ideal for scenarios with high traffic loads.
High Memory Usage while High Concurrency:

Apache is also able to handle a large number of concurrent connections efficiently but for this, it consumes highly such as high system resources.
Built-in WebSockets Support:

The native support of NGINX for WebSockets allows it to efficiently handle real-time communication between clients and servers over a single, long-lived connection.
Support WebSockets with additional Module:

Apache can support WebSockets just by using the additional modules since it does not have any native support for WebSockets.
Built-in Caching Feature

NGINX servers have built-in caching capabilities that help to cache static content & even dynamic content to improve performance & reduce server load.
Inflexible Caching Feature

You can configure the Apache server for caching the content but NGINX’s caching mechanisms are often more flexible and performant.
Event-Driven Architecture:

NGINX uses an event-driven asynchronous architecture that allows it to handle thousands of connections simultaneously with low resource consumption.
Thread-based architecture

Apache traditionally uses a process-based or thread-based architecture which may not scale as well in high-concurrency scenarios.
NGINX Plus Features:

NGINX Plus consistently adds innovative functionalities for hasty and flawless application delivery, such as JavaScript configuration that supports dynamic modules.
Apache Plus Features:

Apache Plus feature, a subscription-based service that provides additional functionalities, support, and maintenance for Apache software users.

Let’s Recap Before You Go!

This blog post will give you comprehensive & step-by-step guidance that will catch all the information & every executing point for Installing PHP8.3 & MySQL 8.0. Whereas, we will use Ubuntu 22.04 OS version and NGINX Server in Microsoft Azure. Along with this, here you’ll get prerequisites, benefits of the NGINX server over Apache, & other additional information like the significance of PHP in FPM instead of PHP alone. Therefore, without causing a delay, follow the steps and install PHP8.3 for a smoother workflow.

Stay updated by signing up for our newsletter

Read our full Privacy Policy here.