Web installer on Ubuntu 18.04 server: 500 internal server error

Nextcloud version (eg, 18.0.2): Latest, presumably.
Operating system and version (eg, Ubuntu 20.04): Ubuntu server 18.04
Apache or nginx version (eg, Apache 2.4.25): Apache2 2.4.29-1ubuntu4
PHP version (eg, 7.1): 7.2

The issue you are facing:
Installer says all dependencies are met, but once the installation is said to be over, the application gives me a “500 Internal Server Error”

Is this the first time you’ve seen this error? (Y/N): Yes, this is my first time I install nextcloud.

Steps to replicate it:

  1. download the installer php in the public_html of the user
  2. point the browser to http://myserver/~nextcloud/setup-nextcloud.php
  3. follow instructions (all dependencies met)
  4. Final step says “SUCCESS: Nextcloud is now installed. [NEXT]”
  5. Boom! 500 error.

The output of your Nextcloud log in Admin > Logging: I have no idead of what you are talking about.

N/A

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!): There’s no such a file. I have a config directory with a config.sample.php file in it.

N/A

The output of your Apache/nginx/system log in /var/log/access.log:

1.2.3.4 - - [09/May/2020:18:41:09 +0200] "GET /~nextcloud/setup-nextcloud.php HTTP/1.1" 500 804 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"

/var/log/error.log

[Sat May 09 18:41:09.433050 2020] [core:alert] [pid 6365] [client 1.2.3.4:48078] /home/nextcloud/public_html/.htaccess: php_value not allowed here

That .htaccess file actually contains what seems to be an Apache configuration file fragment.

It looks like it can be related to this other problem, but still I don’t get the point as I was expecting the web installer to check pre-requisites.

Problem solved (or at least worked around)!

Two configuration items need to be changed in Apache2.

  1. In /etc/apache2/mods-enabled/php7.2.conf you need to enable “PHP scripts in user directories” by commenting out all of the lines for <IfModule mod_userdir.c>

  2. In /etc/apache2/mods-enabled/userdir.conf you need to replace the line AllowOverride FileInfo AuthConfig Limit Indexes with AllowOverride all

I would like some Apache2 guru to validate the second change as I am not one myself.
But this made the web installer fully working.