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

How to install php-fpm under centos7

王林
王林Original
2020-07-29 13:58:302269browse

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

Start php-fpm:

sudo systemctl start php-fpm

Set up automatic startup:

sudo systemctl enable php-fpm

Check whether the startup is successful:

ps aux | grep php-fpm

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;
    }

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!

Statement:
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