ownCloud .htaccess breaks installation


#1

After almost any upgrade or update I had to fix my .htaccess and ownCloud X is no exception to that.

Instead of using

php_value upload_max_filesize 513M
php_value post_max_size 513M
php_value memory_limit 512M
php_value mbstring.func_overload 0
php_value default_charset 'UTF-8'
php_value output_buffering 0

the developer should have used:

<IfModule mod_php7.c>
  php_value upload_max_filesize 513M
  php_value post_max_size 513M
  php_value memory_limit 512M
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>

A little side-note to those hosting at Domainfactory:

You need to edit the php.ini for php7 to include the php extension intl:

extension_dir="/usr/local/lib/php_modules/7-70STABLE"
extension = "intl.so"

…and you need to change the following values in .htaccess:

from:

<IfModule mod_env.c>
  # Add security and privacy related headers
  Header set X-Content-Type-Options "nosniff"
  Header set X-XSS-Protection "1; mode=block"
  Header set X-Robots-Tag "none"
  Header set X-Frame-Options "SAMEORIGIN"
  Header set X-Download-Options "noopen"
  Header set X-Permitted-Cross-Domain-Policies "none"
  SetEnv modHeadersAvailable true
</IfModule>

to:

<IfModule mod_env.c>
  # Add security and privacy related headers
  Header always set X-Content-Type-Options "nosniff"
  Header always set X-XSS-Protection "1; mode=block"
  Header always set X-Robots-Tag "none"
  Header always set X-Frame-Options "SAMEORIGIN"
  Header always set X-Download-Options "noopen"
  Header always set X-Permitted-Cross-Domain-Policies "none"
  Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
  SetEnv modHeadersAvailable true
  </IfModule>

#2

See [1]. If you use the official supported combination:

Apache + mod_php

or the community supported:

nginx + php-fpm this also won't happen.

To use everything else is strongly discouraged and might show issue like this as ownCloud is fully untested.

[1]


500 Internal Server Error with php-fpm
#3

Thanks for pointing this out. It is just kinda sad.
I think it would be a really low hanging fruit for ownCloud to not f* up the .htaccess-file with every update.

It is nice if someone decided there is the official supported combination but many of us use webhosters that do use the very common combination of php + fcgi and there is little reason, why that should not work. I did not even know until know I was on fcgi.


#4

Please note this is a user-based support forum, there is mostly nothing what we users in here can do for you in this case.

Nut just a short additional note to this:

This combination had shown various issues in the past which doesn't happened / showing up with the mentioned combinations above. So there were reasons, why it wasn't working and some one decided to define that "official supported combination".