Installing and configuring PHP on a server PHP is a popular open-source general-purpose scripting language. It is specifically designed for web development, and its code can be embedded directly into HTML.
Adding required libraries
Use the following command:
sudo apt-get -y install ca-certificates apt-transport-https
PHP installation
You need to use the following two commands:
↙ Click a line to copy it wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add - Copied echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php.list Copied
Next, install PHP and its core modules:
sudo apt-get -y install php7.4 php7.4-{mcrypt,mysql,fpm}Previous article Installing and Configuring Apache2 on Linux Next article Installing and configuring MySQL (MariaDB)