Home > Article > Backend Development > How to install php-fpm under centos7
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.
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!