Home Backend Development PHP Problem How to install PHP via yum and enable FPM mode

How to install PHP via yum and enable FPM mode

Apr 21, 2023 am 09:07 AM

1. Background introduction

In Linux systems, yum is one of the main ways to manage and install software packages. PHP is a commonly used Web programming language, and FPM is a PHP operating mode that can improve the performance and stability of the Web server. This article will detail how to install PHP through yum and enable FPM mode.

2. Install PHP with yum

  1. Preparation work

First, the list of software packages that need to be upgraded to the system:

sudo yum update
Copy after login
  1. Install PHP

Use yum to install PHP, you can use the following command:

sudo yum install php
Copy after login

During the installation process, you will be prompted whether to continue. Just enter y and press Enter.

  1. Verify PHP installation

After the installation is completed, you can verify whether PHP is installed correctly by running the following command:

php -version
Copy after login

If the PHP version number is displayed correctly, please indicate PHP has been installed correctly.

3. Enable FPM mode

  1. Install FPM

You can use the following command to install FPM:

sudo yum install php-fpm
Copy after login

During the installation process, there will be Prompt whether to continue. Just enter y and press Enter.

  1. Configuring FPM

After the installation is complete, you need to edit the PHP FPM configuration file and find the following two settings:

;listen = 127.0.0.1:9000
;listen = /run/php-fpm/php-fpm.sock
Copy after login

By default, the One line is commented out, the second line is uncommented and set up to listen to the Unix Socket. If you want to use TCP/IP port listening, just uncomment the first line. For example, change the first line to:

listen = 127.0.0.1:9000
Copy after login
  1. Start FPM

After configuring FPM, you need to start FPM to run. Run the following command:

sudo systemctl start php-fpm
Copy after login
  1. Verify FPM

Run the following command to view the port FPM is listening on:

sudo netstat -anp | grep php-fpm
Copy after login

If it starts successfully, you should be able to See the port you are listening on.

4. Summary

Using yum to install PHP is a convenient and fast way. Enabling FPM mode can improve the performance and stability of the web server. This article introduces the process from installing PHP to enabling FPM in detail. I hope it will be helpful to readers.

The above is the detailed content of How to install PHP via yum and enable FPM mode. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1272
29
C# Tutorial
1252
24