作者:无情泪看红尘 | 来源:互联网 | 2020-12-15 13:17
centos安装phpfpm的方法:首先通过“yuminstall-yphp-fpm”安装“php-fpm”;然后通过“systemctlstartphp-fpm”启动“php-fpm”即可。
centos安装php fpm的方法:首先通过“yum install -y php-fpm”安装“php-fpm”;然后通过“systemctl start php-fpm”启动“php-fpm”即可。
具体如下:
# 开启gzip压缩
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
# gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-Javascript text/css application/xml text/Javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary off;
gzip_disable "MSIE [1-6]\.";
location / {
root /var/www/html;
index index.php index.html index.htm;
}
#此配置使nginx支持php
location ~ \.php$ {
root /var/www/html; #指定php的根目录
fastcgi_pass 127.0.0.1:9000;#php-fpm的默认端口是9000
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
然后重启nginx即可!注:php-fpm默认根目录为:/var/www/html
以上就是centos安装php fpm的方法的详细内容,更多请关注 第一PHP社区 其它相关文章!