How to install PHP via yum and enable FPM mode
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
- Preparation work
First, the list of software packages that need to be upgraded to the system:
sudo yum update
- Install PHP
Use yum to install PHP, you can use the following command:
sudo yum install php
During the installation process, you will be prompted whether to continue. Just enter y and press Enter.
- Verify PHP installation
After the installation is completed, you can verify whether PHP is installed correctly by running the following command:
php -version
If the PHP version number is displayed correctly, please indicate PHP has been installed correctly.
3. Enable FPM mode
- Install FPM
You can use the following command to install FPM:
sudo yum install php-fpm
During the installation process, there will be Prompt whether to continue. Just enter y and press Enter.
- 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
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
- Start FPM
After configuring FPM, you need to start FPM to run. Run the following command:
sudo systemctl start php-fpm
- Verify FPM
Run the following command to view the port FPM is listening on:
sudo netstat -anp | grep php-fpm
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics









