博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Nginx] - PHP+FPM相关的配置
阅读量:6177 次
发布时间:2019-06-21

本文共 3668 字,大约阅读时间需要 12 分钟。

CodeIgniter的配置:

worker_processes  1;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    sendfile        on;    keepalive_timeout  65;    fastcgi_connect_timeout 300s;    fastcgi_send_timeout 300s;    fastcgi_read_timeout 300s;    fastcgi_buffer_size 128k;    fastcgi_buffers 8 128k;#8 128    fastcgi_busy_buffers_size 256k;    fastcgi_temp_file_write_size 256k;    fastcgi_intercept_errors on;    #gzip  on;    server {        listen       80;        #server_name  localhost;        location / {                root   html;                index  index.php index.html index.htm;                try_files $uri $uri/ /index.php?$uri&$args;        }        location ~ \.php$ {                include        fastcgi_params;                root           html;                fastcgi_pass   127.0.0.1:9000;                fastcgi_index  index.php;                fastcgi_split_path_info ^((?U).+.php)(/?.+)$;                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                fastcgi_param PATH_INFO $fastcgi_path_info;                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;        }    }}

 

ThinkPHP配置:

worker_processes  1;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    sendfile        on;    keepalive_timeout  65;    fastcgi_connect_timeout 300s;    fastcgi_send_timeout 300s;    fastcgi_read_timeout 300s;    fastcgi_buffer_size 128k;    fastcgi_buffers 8 128k;#8 128    fastcgi_busy_buffers_size 256k;    fastcgi_temp_file_write_size 256k;    fastcgi_intercept_errors on;    #gzip  on;    server {        listen       80;        #server_name  localhost;        location / {                root   html;                index  index.php index.html index.htm;                #try_files $uri $uri/ /index.php?$uri&$args;                if (!-e $request_filename) {                        rewrite ^(.*)$ /index.php?s=$1 last;                        break;                }        }        location ~ \.php$ {                #include        fastcgi_params;                include        fastcgi.conf;                root           html;                fastcgi_pass   127.0.0.1:9000;                fastcgi_index  index.php;                fastcgi_split_path_info  ^(.+\.php)(/.*)$;                fastcgi_param  PATH_INFO $fastcgi_path_info;        }    }}

 

Laravel配置:

worker_processes  1;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    sendfile        on;    keepalive_timeout  65;    fastcgi_connect_timeout 300s;    fastcgi_send_timeout 300s;    fastcgi_read_timeout 300s;    fastcgi_buffer_size 128k;    fastcgi_buffers 8 128k;#8 128    fastcgi_busy_buffers_size 256k;    fastcgi_temp_file_write_size 256k;    fastcgi_intercept_errors on;    #gzip  on;        server {                listen 80;                #server_name localhost;                root /usr/local/nginx/html/public;                index index.html index.php;                location / {                        try_files $uri $uri/ /index.php$is_args$query_string;                }                location ~ \.php$ {                        try_files $uri =404;                        fastcgi_pass 127.0.0.1:9000;                        fastcgi_index index.php;                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                        include fastcgi_params;                }        }}

 


 

 

前提是要启动PHP的FPM(默认端口为9000):

/usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf

 

转载地址:http://rfzda.baihongyu.com/

你可能感兴趣的文章
table的td合并
查看>>
「转」framebuffer驱动
查看>>
用php获取56视频无广告播放地址
查看>>
什么是商业智能
查看>>
OpenStack设计与实现(二)Libvirt简介与实现原理
查看>>
Fastjson序列化导致BeetlSQL无限循环查询的解决方案
查看>>
spring 系列教程一:概述
查看>>
Docker 被墙的解决方法
查看>>
CentOS上安装redis
查看>>
pam后门 和应用实例
查看>>
Android 4.3源码的下载
查看>>
缓存中常见的一些问题
查看>>
浅谈struts1和struts2框架(转载+整理)
查看>>
(四)工厂方法模式详解(另附简单工厂的死亡之路)
查看>>
scikit-learn基础介绍
查看>>
static{}语句块详解
查看>>
elasticsearch 5.x常见问题整理
查看>>
nginx-server-backup策略说明
查看>>
计算机硬件、驱动程序和操作系统
查看>>
mysql 下载及安装方法
查看>>