How to install php7.2 on linux

藏色散人
Release: 2023-03-17 20:14:01
Original
2331 people have browsed it

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.

How to install php7.2 on linux

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

Configure PHP service Running account and group

app@matomo:~$sudo vim /etc/php-fpm.d/www.conf
Copy after login

As shown in the figure, modify user and group to your own definition

How to install php7.2 on linux

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!