Want more timely Centmin Mod News Updates?
Become a Member

Beta Branch add fixphpfpm_includes function to fix php.conf syntax

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jul 20, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    30,180
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    9:48 PM
    Nginx 1.13.x
    MariaDB 5.5
  2. eva2000

    eva2000 Administrator Staff Member

    30,180
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    9:48 PM
    Nginx 1.13.x
    MariaDB 5.5
    when you run updated centmin mod 123.09beta01 (or 123.08stable) centmin.sh it will auto sync the new changes with your existing installs php.conf include files with output similar to below
    Code (Text):
    ./centmin.sh
    
    /etc/init.d /usr/local/src/centminmod
    /usr/local/src/centminmod
    updating php-fpm config files syntax
    /usr/local/nginx/conf/php-pool5.conf
    location ~ [^/]\.php(/|$) {
        if (!-f $document_root$fastcgi_script_name) { return 404; }
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_param  SCRIPT_FILENAME    $request_filename;
    updating php-fpm config files syntax
    /usr/local/nginx/conf/php_sendy.conf
    location ~ [^/]\.php(/|$) {
        if (!-f $document_root$fastcgi_script_name) { return 404; }
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_param  SCRIPT_FILENAME    $request_filename;
    updating php-fpm config files syntax
    /usr/local/nginx/conf/php-pool2.conf
    location ~ [^/]\.php(/|$) {
        if (!-f $document_root$fastcgi_script_name) { return 404; }
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_param  SCRIPT_FILENAME    $request_filename;
    updating php-fpm config files syntax
    /usr/local/nginx/conf/php-pool3.conf
    location ~ [^/]\.php(/|$) {
        if (!-f $document_root$fastcgi_script_name) { return 404; }
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_param  SCRIPT_FILENAME    $request_filename;
    updating php-fpm config files syntax
    /usr/local/nginx/conf/php.conf
    location ~ [^/]\.php(/|$) {
        if (!-f $document_root$fastcgi_script_name) { return 404; }
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_param  SCRIPT_FILENAME    $request_filename;
    updating php-fpm config files syntax
    /usr/local/nginx/conf/php-pool4.conf
    location ~ [^/]\.php(/|$) {
        if (!-f $document_root$fastcgi_script_name) { return 404; }
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_param  SCRIPT_FILENAME    $request_filename;
    Restarting nginx (via systemctl):  [  OK  ]
    Gracefully shutting down php-fpm  done
    Starting php-fpm  done
    

    example of updated /usr/local/nginx/conf/php.conf include file after auto sync'd changes
    Code (Text):
    location ~ [^/]\.php(/|$) {
        if (!-f $document_root$fastcgi_script_name) { return 404; }
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_pass   127.0.0.1:9000;
        #fastcgi_pass   unix:/tmp/php5-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_param  SCRIPT_FILENAME    $request_filename;
        #fastcgi_param PHP_ADMIN_VALUE open_basedir=$document_root/:/usr/local/lib/php/:/tmp/;
    
    # might shave 200+ ms off PHP requests
    # which don't pass on a content length header
    # slightly faster page response time at the
    # expense of throughput / scalability
    #sendfile on;
    #tcp_nopush off;
    #keepalive_requests 0;
    
    fastcgi_connect_timeout 60;
    fastcgi_send_timeout 180;
    fastcgi_read_timeout 180;
    fastcgi_buffer_size 512k;
    fastcgi_buffers 512 16k;
    fastcgi_busy_buffers_size 1m;
    fastcgi_temp_file_write_size 4m;
    fastcgi_max_temp_file_size 4m;
    fastcgi_intercept_errors on;
    
    # next 3 lines when uncommented / enabled
    # allow Nginx to handle uploads which then 
    # passes back the completed upload to PHP
    #fastcgi_pass_request_body off;
    #client_body_in_file_only clean;
    #fastcgi_param  REQUEST_BODY_FILE  $request_body_file;
    
    #new .04+ map method
    fastcgi_param HTTPS $server_https;
    
    # comment out PATH_TRANSLATED line if /usr/local/lib/php.ini sets following:
    # cgi.fix_pathinfo=0 
    # as of centminmod v1.2.3-eva2000.01 default is set to cgi.fix_pathinfo=1
    
    fastcgi_param  PATH_INFO          $fastcgi_path_info;
    fastcgi_param  PATH_TRANSLATED    $document_root$fastcgi_path_info;
    
    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;
    
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    fastcgi_param  REQUEST_SCHEME     $scheme;
    fastcgi_param  HTTPS              $https if_not_empty;
    fastcgi_param  HTTP_PROXY         "";
    
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
    
    fastcgi_param  REMOTE_ADDR        $remote_addr;
    fastcgi_param  REMOTE_PORT        $remote_port;
    fastcgi_param  SERVER_ADDR        $server_addr;
    fastcgi_param  SERVER_PORT        $server_port;
    fastcgi_param  SERVER_NAME        $server_name;
    
    # Set php-fpm geoip variables
    fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
    fastcgi_param GEOIP_COUNTRY_CODE3 $geoip_country_code3;
    fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name;
    fastcgi_param GEOIP_CITY_COUNTRY_CODE $geoip_city_country_code;
    fastcgi_param GEOIP_CITY_COUNTRY_CODE3 $geoip_city_country_code3;
    fastcgi_param GEOIP_CITY_COUNTRY_NAME $geoip_city_country_name;
    fastcgi_param GEOIP_REGION $geoip_region;
    fastcgi_param GEOIP_CITY $geoip_city;
    fastcgi_param GEOIP_POSTAL_CODE $geoip_postal_code;
    fastcgi_param GEOIP_CITY_CONTINENT_CODE $geoip_city_continent_code;
    fastcgi_param GEOIP_LATITUDE $geoip_latitude;
    fastcgi_param GEOIP_LONGITUDE $geoip_longitude;
    
    # PHP only, required if PHP was built with --enable-force-cgi-redirect
    fastcgi_param  REDIRECT_STATUS    200;
    
                       }