3

I'm trying to upgrade to the latest version of phpbb3.2 by following this guide, but I'm getting a 500 Internal Server Error and the following error in my apache 2.4 error log when I try to access the /install directory:

C:/website/forum/.htaccess: Require not allowed in <Files> context

I tried googling for the "Require not allowed in Files context" error, but there are literally no results. Must be a rare or a newly introduced error.

The htaccess in question contains the following:

<IfModule mod_version.c>
    <IfVersion < 2.4>
        <Files "config.php">
            Order Allow,Deny
            Deny from All
        </Files>
        <Files "common.php">
            Order Allow,Deny
            Deny from All
        </Files>
    </IfVersion>
    <IfVersion >= 2.4>
        <Files "config.php">
            Require all denied
        </Files>
        <Files "common.php">
            Require all denied
        </Files>
    </IfVersion>
</IfModule>
<IfModule !mod_version.c>
    <IfModule !mod_authz_core.c>
        <Files "config.php">
            Order Allow,Deny
            Deny from All
        </Files>
        <Files "common.php">
            Order Allow,Deny
            Deny from All
        </Files>
    </IfModule>
    <IfModule mod_authz_core.c>
        <Files "config.php">
            Require all denied
        </Files>
        <Files "common.php">
            Require all denied
        </Files>
    </IfModule>
</IfModule>

Any idea how to solve this?

EDIT: I used the command mentioned in the guide as an alternative to the install directory steps and completed the guide, but even accessing the root forum url still gives the same error, so this issue is not related to the "install/" instructions.

Cohaven
  • 163
  • 1
  • 10

2 Answers2

5

AllowOverride httpd.conf directive requires an AuthConfig option to be enabled to use the Required directive in htaccess files.

https://www.phpbb.com/community/viewtopic.php?f=556&t=2492006&p=15130746#p15130746

Cohaven
  • 163
  • 1
  • 10
  • Found a similar issue migrating an old Bugzilla 5.0.6 instance from Apache 2.2 to Apache 2.4. Adding `AuthConfig` to the `AllowOverride` directive in the Apache 2.4 configuration fixed the problem. – David Le Borgne May 14 '21 at 09:00
1

In case of linux/ubuntu/etc, you might add AllowOverride AuthConfig in /sites-enabled/your-site.conf:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ...
    <Directory /var/www/your_path/>
        ...
        AllowOverride AuthConfig
        ...
    </Directory>
</VirtualHost>
</IfModule>
T.Todua
  • 53,146
  • 19
  • 236
  • 237