PHP is the most popular scripting language used in website and web applications development. The PHP language is released under open-source standards, also object-oriented and interpreted scripting language that can be executed at the server-side. Being an interpreted language it means there is no need for compilation as the application executes directly on the server to generate dynamic pages.
As of this article update the latest release of PHP available for installation is PHP 8.3. PHP is a simple language and easy to learn for those getting started with web development. PHP can also be embedded into HTML pages. This article will discuss the process of installing PHP on Linux Mint 22.
How To Install PHP on Linux Mint 22
You should have a running Linux Mint 22 installation to use this guide. Login as a user with sudo access and update your APT index:
sudo apt update
Once done then you can install PHP on Linux Mint 22. The default version available is PHP 8.3. The command below will install PHP 8.3 and standard extensions.
sudo apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
Enter Y to proceed:

Confirm installation of PHP on Linux Mint 22:
$ php --version
PHP 8.3.6 (cli) (built: Mar 19 2025 10:08:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies
If you don’t want Apache web server disable its service.
sudo systemctl disable --now apache2
Other extensions of PHP can be installed using apt command by substituting <extension-name> with the extension you want to install.
sudo apt install php-<extension-name>
The example below installs PHP redis and memcache modules.
sudo apt install php-memcache php-redis
You now have PHP installed on your Linux Mint 22 system. If you intend on using PHP with nginx, the server can be installed by running the command below as sudo user.
sudo apt install nginx
Refer to nginxconfig.io for easy configuration of Nginx with PHP FPM.
Other Linux Mint guides: