
You can install all of them with the following command: apt-get install php8.0-fpm libapache2-mod-fcgid -y

If you are using Php-FPM (FastCGI process manager) with Apache then you will also need to install some extra packages in your system. Once the installation is finished, reload the Apache service to apply the configuration changes: systemctl restart apache2 Install PHP-FPM for Apache You can install it with the following command: apt-get install libapache2-mod-php8.0 -y If you are using Apache as a web server then you will need to install PHP module for Apache in your system. In this section, we will show you how to integrate PHP 8.0 with Apache webserver. You can also install some commonly used PHP extensions by running the following command: apt-get install php8.0-common php8.0-curl php8.0-gd php8.0-mysql php8.0-xml php8.0-imagick php8.0-cli php8.0-mbstring php8.0-opcache php8.0-soap php8.0-zip php8.0-dev php8.0-imap -y Install PHP 8.0 with Apache With Zend OPcache v8.0.0, Copyright (c), by Zend Technologies Install PHP 8.0 Extensions Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies You should get the following output: PHP 8.0.0 (cli) (built: 12:26:22) ( NTS ) Once the PHP 8.0 is installed, you can verify the installed version with the following command: php -v Once the repository is enabled, install the PHP 8.0 by running the following command: apt-get install php8.0 -y

You can install the Ondrej PHP repository by running the following command: apt-get install ca-certificates apt-transport-https software-properties-common gnupg2 -y

With Ondrej repository, you can install multiple PHP versions in your system. So you will need to add the Ondrej/php repository to your system.

It was created by Rasmus Lerdorf and used as a general-purpose programming language.Īt the time of writing this tutorial, the latest version of PHP is PHP 8.0. PHP also know as “ PHP: Hypertext Preprocessor” is an open-source and most widely used scripting language used for developing dynamic and responsive web applications.
