How to fix config file?

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 21.0.1
Operating system Ubuntu 20.04
Apache version 2.4
PHP version 7.4

The issue you are facing:
I am setting up a nextcloud server for the first time and its all working but when i went to edit the config files trusted domains i get an internal error on the website and cant access the site. Everything appears to be fine in the config file but it still wont work
Is this the first time you’ve seen this error? (Y/N):
y

The output of your Nextcloud log in Admin > Logging:

PHP Parse error:  syntax error, unexpected 'array' (T_ARRAY), expecting ')' in /var/www/nextcloud/config/config.php on line 7

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

<?php
$CONFIG = array (
  'instanceid' => '************',
  'passwordsalt' => '******************************',
  'secret' => '*************************************************',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '*****.*****************.***',
    2 => '192.168.***.***',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => 'http://192.168.***.***',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '**************',
  'installed' => true,
  'memcache.local' => '\OC\Memcache\APCu',
);

On a first glance I also can’t see a mistake. Maybe a wrong invisible character?

Sorry, I can’t help with fixing the file. But: you can also let Nextcloud add trusted domains with the occ-command. This should work and is maybe a better approach.

1 Like

thanks for that, im just going to start from scratch and retry, i will use that command the next time i add trusted domains.