📅  最后修改于: 2023-12-03 15:09:25.580000             🧑  作者: Mango
PHP is a popular open-source server-side scripting language used to build dynamic web applications. PHP 7.4 is the latest stable release of PHP, which provides enhanced performance and security over its predecessors. In this guide, we will show you how to install PHP 7.4 on Linux.
Before installing PHP 7.4, you should have the following prerequisites:
To install PHP 7.4, we will need to add the PHP 7.4 repository to our system. The following commands will add the repository and update the system repositories:
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Once the repository is added, we can proceed to install PHP 7.4. Run the following command:
sudo apt-get install php7.4
If you need to install additional PHP extensions, such as the MySQL driver, you can use the following command format:
sudo apt-get install php7.4-mysql
Replace 'mysql' with the name of the extension you need to install.
After the installation is complete, we can verify if PHP 7.4 is installed correctly using the following command:
php -v
This command will show the version number of PHP installed on your system.
In this guide, we have shown you how to install PHP 7.4 on Linux. With PHP 7.4 installed on your system, you can develop and run modern web applications with ease, security, and performance.