栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

php-fpm+nginx

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

php-fpm+nginx

1、部署mysql
2、部署nginx

       root    /etc/nginx/html/XX;
        location / {
                index index.php index.html;
        }
        location ~ .php$ {
          #try_files $uri $uri/ $uri.php?$args;
          #fastcgi_pass 127.0.0.1:9001;
          fastcgi_pass unix:/var/run/php73-fpm/php73-fpm.sock;
          fastcgi_index  index.php;
          include fastcgi.conf;
          fastcgi_split_path_info ^(.+.php)(/.+)$;
          fastcgi_param   PATH_INFO   $fastcgi_path_info;
          fastcgi_param   script_FILENAME $document_root$fastcgi_script_name;
        }

3、部署php-fpm

wget https://www.php.net/distributions/php-7.3.32.tar.gz
cd php-7.3.32


./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization  --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml

cp php.ini-development /usr/local/php/php.ini
cp /usr/local/php/etc/php-fpm.d/www.conf.default  /usr/local/php/etc/php-fpm.d/www.conf
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp sapi/fpm/php-fpm /usr/local/bin

4、注意事项
部分png,css等资源报错403,可尝试
php.ini的cgi.fix_pathinfo=1
#php-fpm.conf添加
security.limit_extensions=.php .html .js .css .jpg .jpeg .gif .png .htm .ico
php.ini修改
extension = gd.so

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/468370.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号