[split from] Can't install phpBB due to a redirect?

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
prcarp
Registered User
Posts: 2
Joined: Mon Sep 14, 2020 8:47 pm

[split from] Can't install phpBB due to a redirect?

Post by prcarp »

I think I am having the same problem. We are using nginx as our server and the forum is a subfolder off of a test/development site. I get to the Introduction page and everything looks fine there. I clicked on the Installation Guide and got that, too. I made sure I followed those directions (chmod +x for the listed files and adjusted the write permissions for config.php). I went back to the Introduction page but every link I click on, Install tab, Support tab, License tab, brings me back to the same Introduction page. I can never get to the database or any other configuration page. I looked at the nginx error log and there are no new messages.

I did temporarily rename .htaccess but no change. Any thoughts on what I should look for next?

Background details:
* PHP 7.2.24
* PostgreSQL 10.5
* Hosted on Azure
* Ubuntu 18.04.2 LTS

nginx params:
root /var/www/api-dev/public;

location / {
try_files $uri /index.php$is_args$args;
}

location ~ ^/index\.php(/|$) {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/index.php/some-path
# Remove the internal directive to allow URIs like this
internal;

# for decompression
client_max_body_size 512k; # Max request body size of 512 KB
client_body_buffer_size 512k;

set $max_chunk_size 10240; # Chunks of 10 KB
set $max_body_size 524288; # Max inflated body size of 512 KB

rewrite_by_lua_file /usr/local/src/nginx/inflate_body.lua;
}

location ^~ /forum {
alias /var/www/api-dev/forum/public;
try_files $uri $uri/ @forum;

location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
include fastcgi_params;

fastcgi_split_path_info ^(.+\.php)(/.*)$;
#fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
#fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}

location @forum {
rewrite /forum/(.*)$ /forum/index.php?/$1 last;
}

location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
User avatar
EA117
Registered User
Posts: 1805
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: [split from] Can't install phpBB due to a redirect?

Post by EA117 »

On NGINX it makes sense that renaming the .htaccess wouldn't have had any effect. The sample NGINX configuration provided with phpBB does have some additional /install/ folder-specific rules compared to your current configuration. I'm not any kind of NGINX expert or even proficient, but that's what I would be looking at next.

p.s. If you edit your original post and wrap some [code][/code] tags around your configuration file content, it turns into something much easier to read.
prcarp
Registered User
Posts: 2
Joined: Mon Sep 14, 2020 8:47 pm

Re: [split from] Can't install phpBB due to a redirect?

Post by prcarp »

Thanks. I put in the mods I think were necessary for nginx per your suggestion. I put phpBB in a subdirectory under our domain called 'forum' so I thought I caught all the instances that needed changing. Unfortunately, I now get error 403 Forbidden. With a quick glance, do you see if I missed anything?

Code: Select all

    root /var/www/api-dev/public;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index\.php(/|$) {
        fastcgi_pass            unix:/run/php/php7.2-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        # Prevents URIs that include the front controller. This will 404:
        # http://domain.tld/index.php/some-path
        # Remove the internal directive to allow URIs like this
        internal;

        # for decompression
        client_max_body_size 512k;    # Max request body size of 512 KB
        client_body_buffer_size 512k;

        set $max_chunk_size 10240;  # Chunks of 10 KB
        set $max_body_size 524288;  # Max inflated body size of 512 KB
 
        rewrite_by_lua_file /usr/local/src/nginx/inflate_body.lua;
    }

    location ^~ /forum {
        alias /var/www/api-dev/forum/public;
        try_files $uri $uri/ @forum;
        
        location ~ \.php$ {
            fastcgi_pass            unix:/run/php/php7.2-fpm.sock;
            include fastcgi_params;
            
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            #fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            #fastcgi_param DOCUMENT_ROOT $realpath_root;
            fastcgi_param SCRIPT_FILENAME $request_filename;
        }
    }

    location @forum {
        rewrite /forum/(.*)$ /forum/index.php?/$1 last;
    }
    
    location ~ \.php$ {
        fastcgi_pass            unix:/run/php/php7.2-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
    }

    # Correctly pass scripts for installer
    location /forum/install/ {
        # phpBB uses index.htm
        try_files $uri $uri/ @rewrite_installapp =404;

        # Pass the php scripts to fastcgi server specified in upstream declaration.
        location ~ \.php(/|$) {
            # Unmodified fastcgi_params from nginx distribution.
            include fastcgi_params;
            
            # Necessary for php.
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
            
            try_files $uri $uri/ /forum/install/app.php$is_args$args =404;
            fastcgi_pass            unix:/run/php/php7.2-fpm.sock;
        }
    }

    location @rewrite_installapp {
        rewrite ^(.*)$ /forum/install/app.php/$1 last;
    }
Post Reply

Return to “[3.3.x] Support Forum”