Regarding these errors:

You may see those on Nextcloud on our servers. Here will we explain why and then how we fix that.

Nextcloud sets certain variables in .htaccess and then uses the getenv() PHP function to read those. However getenv() reads the value of a PHP environment variable (http://php.net/manual/en/function.getenv.php). These would be the variables, as listed when executing the phpinfo() function. There is no guarantee that a variable that you set by using SetEnv in an .htaccess file will be available for getenv() as well. Generally those are available, however.

We use suEXEC on our servers, and for security reasons it passes only a portion of all environment variables to CGI (PHP) scripts.

In order to set custom environment variables in .htaccess and then read them with getenv() in PHP, one must prefix each variable with:

Nextcloud, however, relies on a slightly lower level of security and uses this in .htaccess:

and then later tries to read that in the PHP code. That fails on our server due to our high security.

Thus we edit that line to be:

and then change the reference in the PHP code to match. We use these two commands to adjust the Nextcloud code:

Then all the warnings disappear. The only problem is that now this warning comes up:

which is now expected and can be ignored.

Leave a Reply

Your email address will not be published. Required fields are marked *