PHP Error safe_mode_protected_env_vars not longer available in PHP 5.4

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 14.0.3
Operating system and version (eg, Ubuntu 17.04): Linux alfa3206 4.9.44-040944-generic
Apache or nginx version (eg, Apache 2.4.25): Apache 2.0
PHP version (eg, 7.1): 7.1

The issue you are facing:
Since the update to version 14.0.3 I have this PHP Error in the Log:
PHP Directive ‘safe_mode_protected_env_vars’ is no longer available in PHP 5.4 or newer at Unknown#0

Is this the first time you’ve seen this error? (Y/N):
Yes

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

{"reqId":"ly4UwZzB9OwGn7eU8rKC","level":3,"time":"2018-06-07T15:53:34+00:00","remoteAddr":"46.237.244.210","user":"Administrator","app":"PHP","method":"GET","url":"\/cloud\/index.php\/css\/files\/4fda-a4fe-merged.css?v=8a6574c3-0","message":"Directive 'safe_mode_protected_env_vars' is no longer available in PHP 5.4 or newer at Unknown#0","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"kn7ZgqLEtEMywasgrZwO","level":3,"time":"2018-06-07T15:53:34+00:00","remoteAddr":"46.237.244.210","user":"Administrator","app":"PHP","method":"GET","url":"\/cloud\/index.php\/css\/files_trashbin\/1980-a4fe-trash.css?v=8a6574c3-0","message":"Directive 'safe_mode_protected_env_vars' is no longer available in PHP 5.4 or newer at Unknown#0","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"557cEyn28VLpC5pmVimt","level":3,"time":"2018-06-07T16:38:49+00:00","remoteAddr":"46.237.244.210","user":"Administrator","app":"PHP","method":"GET","url":"\/cloud\/index.php\/css\/files\/4fda-a4fe-merged.css?v=8a6574c3-0","message":"Directive 'safe_mode_protected_env_vars' is no longer available in PHP 5.4 or newer at Unknown#0","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"7iPBEQPrC2MLkhVmabaT","level":3,"time":"2018-06-07T16:38:50+00:00","remoteAddr":"46.237.244.210","user":"Administrator","app":"PHP","method":"GET","url":"\/cloud\/index.php\/css\/files_trashbin\/1980-a4fe-trash.css?v=8a6574c3-0","message":"Directive 'safe_mode_protected_env_vars' is no longer available in PHP 5.4 or newer at Unknown#0","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"zcS3oU2bF8Rmzlpe9rhB","level":2,"time":"2018-06-08T12:57:31+00:00","remoteAddr":"62.91.85.60","user":"--","app":"core","method":"GET","url":"\/cloud\/","message":"Trusted domain error. \"62.91.85.60\" tried to access using \"fischer-engstingen.de\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/67.0.3396.79 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"cumeIz3JcaQekBxQfs3m","level":2,"time":"2018-06-08T12:57:31+00:00","remoteAddr":"62.91.85.60","user":"--","app":"core","method":"GET","url":"\/cloud\/index.php\/js\/core\/merged-template-prepend.js?v=8a6574c3-0","message":"Trusted domain error. \"62.91.85.60\" tried to access using \"fischer-engstingen.de\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/67.0.3396.79 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"AUH8S2p3EMpWQow78p3A","level":3,"time":"2018-06-08T13:04:01+00:00","remoteAddr":"62.91.85.60","user":"Andreas","app":"PHP","method":"MKCOL","url":"\/cloud\/remote.php\/webdav\/FischerICT","message":"Directive 'safe_mode_protected_env_vars' is no longer available in PHP 5.4 or newer at Unknown#0","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/67.0.3396.79 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"q3hAIKtGRfCYAm7PHQKP","level":3,"time":"2018-06-08T13:04:07+00:00","remoteAddr":"62.91.85.60","user":"Andreas","app":"PHP","method":"GET","url":"\/cloud\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","message":"Directive 'safe_mode_protected_env_vars' is no longer available in PHP 5.4 or newer at Unknown#0","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/67.0.3396.79 Safari\/537.36","version":"13.0.3.2"}
{"reqId":"fYLuqMjIAYI1QLpr5kax","level":3,"time":"2018-06-08T13:04:07+00:00","remoteAddr":"62.91.85.60","user":"Andreas","app":"PHP","method":"GET","url":"\/cloud\/index.php\/apps\/activity\/","message":"Directive 'safe_mode_protected_env_vars' is no longer available in PHP 5.4 or newer at Unknown#0","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/67.0.3396.79 Safari\/537.36","version":"13.0.3.2"}

.......

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'instanceid',
  'passwordsalt' => 'passwordsalt',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => 'www.domain.de',
    1 => 'domain.de',
  ),
  'datadirectory' => '/var/www/web23256488/htmlcloud/data',
  'overwrite.cli.url' => 'https://www.domain.de/cloud',
  'dbtype' => 'mysql',
  'version' => '14.0.3.0',
  'dbname' => 'dbname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'dbuser',
  'dbpassword' => 'dbpassword',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'tls',
  'mail_from_address' => 'admin',
  'mail_domain' => 'domain.de',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.domain.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'admin@domain.de',
  'mail_smtppassword' => 'mailpass',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);

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

This is a webspace, I don´t Have access to the Apache log file. Sorry!

PHP 5.4 is not supported any more:
https://docs.nextcloud.com/server/14/admin_manual/installation/system_requirements.html#system-requirements

1 Like

Urge your webspace provider to upgrade to PHP 7.2, or at least 7.0. If they cannot do that, change provider. At best, get a small vserver with root access, then you can install all you want by yourself. Personally, I would never run nextcloud or other services in a webspace. You just have no control.

Thanks for your answers.

But I have php version 7.2.

PHP Version: 7.2.11
DB mysql: 5.7.19

You can see it here:
https://fischer-engstingen.de/cloud/info.php

Sorry, I was a bit too fast. This looks like there is a setting in your php configuration which sets this ‘safe_mode_protected_env_vars’. You are actually using a newer php version but this configuration option was only available until php 5.4. Such things happen most likely when you upgrade several times and keep your old configuration. Such things are a good point to review a bit your configuration settings (remove this option, check perhaps others that might be new and interesting for you, just as a general advise).

Thanks for your answer. I have no possibility to change the php configuration. Therefor I wrote a support ticket to the webspace provider. But they say, that is a problem of NextCloud.

At another webspace provider I have not this problem.

I haven’t found anything in the github server repo where such an option could be set (via php or .htacccess). Perhaps in a module or app or something that is not in the main repo. Other than that I don’t see how Nextcloud could trigger this error?

Is something not working?

Everythings works, I only have the error in the log.
I think it´s a problem of the webspace provider.

That is a original Nextcloud installation. I have no apps or modules installed. The .htaccess is the original .htaccess. I changed nothing.

If you want I can give you acces to the Nextcloud.

I have exact the same behavior on 19.04. The webspace provice has checked the php config and could not find the reason.

Was is solved?
Any idea where to look?

i’m afraid not. you can’t expect to have “the same” problems with a version that is 2 years outdated now. and with a php-version that isn’t anymore supported.

so please feel free to open a new thread, fill in all needed infos andf refer to this thread.

thanks in advance. awww. and welcome to the forum, of course :slight_smile: