[SOLVED] Changes in config file e.g. memory cache configuration take no effect

Nextcloud version: 22.1.1

Operating system and version: Ubuntu 20.04 LTS

Apache version: Apache 2.4.41

PHP version: 7.4.3

Hi NextCloud community,
I have recently installed NextCloud on a server hosted in a data centre and work now through the different security & setup warnings.

Somehow the changes I perform in the config.php do not seem to take any effect on my system. The config.php is located at “~/nextcloud/config”, here is also the config.sample.php located, from which I got the different settings.

My config.php looks like this:


<?php
$CONFIG = [

/** Set default phone number to Germany  */
'default_phone_region' => ‘DE’,

/** Pretty URLs  */
'overwrite.cli.url' => 'https://hostadress/',
'htaccess.RewriteBase' => '/',

/** Disable autocompletion for login  */
'login_form_autocomplete' => false,

/** Data memory caching APCu  */
'memcache.local' => '\OC\Memcache\APCu',

];
?>

None of the included setting take any effect, so I still get the following warnings and also the index.php from sharing links is not removed:

Screenshot 2021-09-21 at 08.22.14

For the configuration of the memory caching I followed the instructions from the NextCloud docs “Memory caching”. I also plan to use Redis, but as long as APCu is not working I don’t need to proceed with that.

Does any one have any idea where the issue is and how I can solve it?

Thank you very much in advance for your kind support!

Did you check that apc.enable_cli=1 in your php.ini? And check that php.ini is correct one, for CLI, FPM you have more php.ini files in a different folders.

Rather than php.ini, I had to add apc.enable_cli=1 to /etc/php/7.4/mods-available/apcu.ini to get everything working correctly.

1 Like

Thanks for the suggestion @mainland. I also tried this, but unfortunately it did also not solve the issue.

@gas85 thanks for checking.

Yes, I have added it to the php.ini in the CLI folder.

Since, no of my configurations is taking effect also not the setting of the default phone number, I assume it is a more basic problem.

1 Like

Your phone country code is correct but not being recognized so there is something wrong with your config.php file format. Please backup your config.php file and check the following:

  1. Delete all commented lines and see if your changes take effect
  2. Review your file format, specifically the opening block characters [ ] and the php close command. My config.php file does not have either (see below) and works fine:
<?php
$CONFIG = array (
  'instanceid' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'passwordsalt' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'trusted_domains' => 
  array (
    0 => '192.168.###.###',
    1 => 'nextcloud.DOMAIN.com',
  ),
  'datadirectory' => '/var/www/DATAFILES',
  'dbtype' => 'mysql',
  'version' => '22.1.1.2',
  'overwrite.cli.url' => 'https://nextcloud.DOMAIN.com/nextcloud',
  'overwriteprotocol' => 'https',
  'dbname' => 'DATABASEPASSWORD',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'DATABASEUSER',
  'dbpassword' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'trashbin_retention_obligation' => 'auto, 30',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud.log',
  'logfilemode' => 416,
  'loglevel' => '0',
  'logdateformat' => 'F d, Y H:i:s',
  'default_phone_region' => 'US',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'maintenance' => false,
  'theme' => '',
);

Be sure to restart Apache between changes.

Thanks for sharing your config.php with me @mainland

I tried it as well with deleting all the comments and also deleting the opening & closing block characters as well as the php close command.

So my config looks now like this:

<?php
$CONFIG = [
'default_phone_region' => 'DE',
'overwrite.cli.url' => 'https://www.hostadress/',
'htaccess.RewriteBase' => '/',
'login_form_autocomplete' => false,
'memcache.local' => '\OC\Memcache\APCu';

Unfortunately, it did not show any effect.

Does the location where the config is saved has any influence? I have saved it in the same folder where the config.sample.php located is, so “~/nextcloud/config”

Your config.php file is located in the correct folder at ~/nextcloud/config.

Can you post your entire config.php file anonymizing all sensitive information? That will make it easier to figure out what is going on.

That above is my entire config.php file. I had created it when setting up NextCloud and it is only in it what I have entered. I understand that it should have been created automatically when setting it up, but it wasn’t.

Alright guys I have solved the issue. I was using the wrong config folder. I was using the one in the home directory of my user not the one in “/var/www/nextcloud”.

Thanks for the support!

That makes a lot more sense now. I was wondering how you even got to the point you were at without all of the DB credentials in your config file.

Please mark as solved.

1 Like