core icon indicating copy to clipboard operation
core copied to clipboard

Set PHP default-charset in the .htaccess file when it is not set in the php.ini file

Open VincentvgNn opened this issue 11 years ago • 8 comments

Description

I separately installed OC 8.0.2 and OC 7.0.2 at a hosting company. An auto-installer "Installatron" did the job for me. Since OC8 I'm getting the same error message as shown in issue #14216 . I cannot access and change the php.ini file. And above, I would have to do that at 2 hosting companies. From running phpinfo.php I can find that the default_charset is set to "no value" at both companies.

To solve the problem I had to put the line php_value default_charset UTF-8 in the .htaccess file just after the line AddDefaultCharset utf-8 (as discussed at: https://forum.owncloud.org/viewtopic.php?f=31&t=26289&sid=05827e7c4d515e32f7b8fe62ec6022c4&start=10 and https://forum.owncloud.org/viewtopic.php?f=31&t=27138 ) I'm not sure about the best position for these UTF-8 setting lines. Anyhow it solves the problem of the error message.

In issue #14966 the introduction of an additional check on the PHP settings in OC8 has been mentioned. That might be the explanation why I have no problems at OC7.

How to get this solution in the installer packages (.htaccess files in the automatic distributions)? In which version can it be introduced?

VincentvgNn avatar Mar 19 '15 23:03 VincentvgNn

@LukasReschke can you please have a look? THX

DeepDiver1975 avatar Mar 20 '15 12:03 DeepDiver1975

That's already fixed in master, but we didn't backport this change to stable8 and older versions. Best idea would be to update the whole stable8 block with the one from master in .htaccess and .users.ini.

PR is at https://github.com/owncloud/core/pull/15231 if we want to backport these.

LukasReschke avatar Mar 26 '15 15:03 LukasReschke

closing as this has been merged

DeepDiver1975 avatar Mar 26 '15 20:03 DeepDiver1975

.htaccess AddDefaultCharset UTF-8 php_value default_charset UTF-8

.user.ini default_charset="UTF-8"

juliogilabert avatar Mar 31 '15 09:03 juliogilabert

@juliogilabert what are you trying to tell us with that comment?

DeepDiver1975 avatar Mar 31 '15 11:03 DeepDiver1975

Hi @DeepDiver1975 I was just commenting how to fix it so more summarized By modifying these two files:

.htaccess AddDefaultCharset UTF-8 php_value default_charset UTF-8

.user.ini default_charset="UTF-8"

juliogilabert avatar Mar 31 '15 11:03 juliogilabert

@juliogilabert The php ones are already in for OC8.0.3: https://github.com/owncloud/core/issues/15231

ghost avatar Apr 01 '15 17:04 ghost

.user.ini default_charset="UTF-8"

@juliogilabert this did the trick for me. Thanks for posting.

Tschoepler avatar Apr 18 '15 10:04 Tschoepler