Home > Backend Development > PHP Problem > How to install php-fpm under centos7

How to install php-fpm under centos7

王林
Release: 2023-03-03 13:30:01
Original
2274 people have browsed it

How to install php-fpm under centos7: 1. Open the terminal; 2. Execute the [yum install] command to install php; 3. Execute the [systemctl start php-fpm] command to start php-fpm.

How to install php-fpm under centos7

Install and configure php-fpm under centos7

(Recommended tutorial: php tutorial)

Install php:

sudo yum install php php-fpm php-mysql php-mbstring php-mcrypt php-sockets php-curl php-common php-xml php-soap
Copy after login

Start php-fpm:

sudo systemctl start php-fpm
Copy after login

Set up automatic startup:

sudo systemctl enable php-fpm
Copy after login

Check whether the startup is successful:

ps aux | grep php-fpm
Copy after login

Configure nginx through fast- cgi mode supports php:

vi /etc/nginx/conf.d/default.conf 

# 去掉文件里已经有的类似这一段的注释,可以根据自己的需要修改, 如果配置文件里没有也可以自己加上。

    location ~ \.php$ {
          root           html;
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
          include        fastcgi_params;
    }
Copy after login

The above is the detailed content of How to install php-fpm under centos7. 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