[Nginx]-PHP+FPM related configuration

Source: Internet
Author: User
Tags sendfile

Configuration of the CodeIgniter:

Worker_processes1; events {Worker_connections1024x768;}    HTTP {include mime.types; Default_type Application/octet-stream;    Sendfile on; Keepalive_timeout $;    Fastcgi_connect_timeout 300s;    Fastcgi_send_timeout 300s;    Fastcgi_read_timeout 300s;    Fastcgi_buffer_size 128k; Fastcgi_buffers8128k;#8  -fastcgi_busy_buffers_size 256k;    Fastcgi_temp_file_write_size 256k;    Fastcgi_intercept_errors on; #gzipOn ; server {Listen the;        #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_pass127.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 configuration:

Worker_processes1; events {Worker_connections1024x768;}    HTTP {include mime.types; Default_type Application/octet-stream;    Sendfile on; Keepalive_timeout $;    Fastcgi_connect_timeout 300s;    Fastcgi_send_timeout 300s;    Fastcgi_read_timeout 300s;    Fastcgi_buffer_size 128k; Fastcgi_buffers8128k;#8  -fastcgi_busy_buffers_size 256k;    Fastcgi_temp_file_write_size 256k;    Fastcgi_intercept_errors on; #gzipOn ; server {Listen the;        #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_pass127.0.0.1:9000;                Fastcgi_index index.php; Fastcgi_split_path_info^ (. +\.php) (/.*)$;        Fastcgi_param path_info $fastcgi _path_info; }    }}

Laravel configuration:

Worker_processes1; events {Worker_connections1024x768;}    HTTP {include mime.types; Default_type Application/octet-stream;    Sendfile on; Keepalive_timeout $;    Fastcgi_connect_timeout 300s;    Fastcgi_send_timeout 300s;    Fastcgi_read_timeout 300s;    Fastcgi_buffer_size 128k; Fastcgi_buffers8128k;#8  -fastcgi_busy_buffers_size 256k;    Fastcgi_temp_file_write_size 256k;    Fastcgi_intercept_errors on; #gzipOn ; server {Listen the;                #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_pass127.0.0.1:9000;                        Fastcgi_index index.php;                        Fastcgi_param script_filename $document _root$fastcgi_script_name;                Include Fastcgi_params; }        }}

The prerequisite is to start the fpm of PHP (the default port is 9000):

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

[Nginx]-PHP+FPM related configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.