Home>Article>Backend Development> How to install php7.2 on linux
How to install php7.2 on Linux: 1. Change the yum source through "sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm"; 2. Through " sudo yum install yum-utils –y" to install PHP and check the PHP version; 3. Set the service to automatically start at boot and start the service; 4. Configure the PHP service running account.
The operating environment of this tutorial: linux5.9.8 system, php7.2 version, DELL G3 computer
How to install php7 on linux. 2 ?
Linux installation PHP7.2
The yum source of Linux does not exist for php7.x, so you need to change the yum source
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum installation PHP
sudo yum -y install php72w-cli php72w-common php72w-devel php-mysqli php72w-fpm php72w php72w-cli php72w-fpm php72w-curl php72w-gd php72w-mysql php72w-xml php72w-mbstring sudo yum install yum-utils –y
Check PHP version
Output the following results, indicating successful installation
app@matomo:~$ php --version PHP 7.2.34 (cli) (built: Oct 1 2020 13:37:37) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Set the service to automatically start at boot and start the service
[app@matomo ~]# sudo systemctl start php-fpm.service [app@matomo ~]# sudo systemctl enable php-fpm.service
Configure PHP service Running account and group
app@matomo:~$sudo vim /etc/php-fpm.d/www.conf
As shown in the figure, modify user and group to your own definition
Restart the php-fpm service
Use sudo systemctl restart php-fpm.service or sudo service php-fpm restart
app@matomo:~$sudo service php-fpm restart Redirecting to /bin/systemctl restart php-fpm.service
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install php7.2 on linux. For more information, please follow other related articles on the PHP Chinese website!