鍍金池/ 問答/PHP/ 如何解決lnmp安裝包 不支持pathinfo模式

如何解決lnmp安裝包 不支持pathinfo模式

vhost 下我的配置文件

server

{
    listen 80;
    #listen [::]:80;
    server_name c.ibs-bj.com ;
    index index.html index.htm index.php default.html default.htm default.php;
    root  /home/wwwroot/c.ibs-bj.com;

    include other.conf;
    #error_page   404   /404.html;

    # Deny access to PHP files in specific directory
    #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

    include enable-php.conf;

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }

    location ~ .*\.(js|css)?$
    {
        expires      12h;
    }

    location ~ /.well-known {
        allow all;
    }

    location ~ /\.
    {
        deny all;
    }


    access_log  /home/wwwlogs/c.ibs-bj.com.log;
}
回答
編輯回答
久舊酒

Nginx配置PATHINFO

location ~ \.php {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    include fastcgi_params;
}
2018年5月27日 13:35
編輯回答
不將就

lnmp有pathinfo的配置文件。
你把enable-php.conf這幾個字改為enable-php-pathinfo.conf

2017年7月14日 16:04