centos7下安装php-fpm的方法:1、打开终端;2、执行【yum install】命令安装php;3、执行【systemctl start php-fpm】命令启动php-fpm。

centos7下安装配置php-fpm
(推荐教程:php教程)
安装php:
sudo yum install php php-fpm php-mysql php-mbstring php-mcrypt php-sockets php-curl php-common php-xml php-soap
启动php-fpm:
sudo systemctl start php-fpm
设置自动启动:
立即学习“PHP免费学习笔记(深入)”;
sudo systemctl enable php-fpm
查看启动是否成功:
ps aux | grep php-fpm
配置nginx通过fast-cgi方式支持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;
}以上就是centos7下如何安装php-fpm的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号