Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

补全: 线上生产环境部署 =》Nginx 服务器配置 文档 #292

Open
jingjingxyk opened this issue Jul 5, 2024 · 0 comments
Open

Comments

@jingjingxyk
Copy link

jingjingxyk commented Jul 5, 2024

原因:按照线上生产环境部署文档 =》Nginx 服务器配置 ,配置完毕,发现 缺少 fastcgi_param PATH_INFO 配置,程序运行不起来

验证:使用 免安装的 nginx php-fpm 运行本项目

         root    /data/web/ThinkAdmin/public/;

        location / {

            # 方式一:
            # try_files $uri /index.php$request_uri;

            # 方式二:
            if (!-e $request_filename) {
                rewrite ^(.*)$ /index.php$1 last;
                # break;
            }
            index  index.php index.html index.htm;
        }

        location ~ ^/index\.php(/|$) { 
            # fastcgi_index   index.php;
            fastcgi_pass    127.0.0.1:9000;
            # fastcgi_pass  /var/run/php-fpm.sock ;

            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            fastcgi_param PATH_INFO $fastcgi_path_info;

            include         fastcgi_params;
            fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            # fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            # fastcgi_param DOCUMENT_ROOT $realpath_root;
            fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
            fastcgi_hide_header X-Powered-By;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant