# What is wrong about my config.php?

**URL:** <https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604>\
**Category:** ℹ️ Support\
**Tags:** docker, configphp, aio\
**Created:** [December 29, 2024, 4:50am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604 "2024-12-29T04:50:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunny](https://help.nextcloud.com/user_avatar/help.nextcloud.com/sunny/32/67562_2.png) [@sunny](https://help.nextcloud.com/u/sunny)\
**Post date:** [December 29, 2024, 4:50am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/1 "2024-12-29T04:50:50Z")

</div>

- Nextcloud Server version:  
_`aio v10.1.1`_
- Operating system and version:  
_`Debian** 12.8.0 "Bookworm`_  
\*my conigfile path is:  
_`/var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/config/`_

I think you don’t need more information about my system in this case?

I did it right and created my own test.config.php, unfortunately there were errors.  
I looked at the documentation and wrote out some variables that I wanted to use.  
I don’t notice that I did something wrong because I did it as in the documentation.

Maybe you notice what could be wrong?

My test.config.php, has the following content.  
I did not use the arguments hidden with ##, but only deposited them to remember them. 😊

```auto
<?php
$CONFIG = array (
  'profile.enabled' => false,
  'default_language' => 'de',
  'force_language' => 'de',
  'default_phone_region' => false,
  'knowledgebaseenabled' => false,
  'knowledgebase.ambedded' => false,
  'allow_user_to_change_display_name' => false,
  'skeletondirectory' =>
  'templatedirectory' =>
  'remember_login_coockie_lifetime' => 60*60*24*15,
  'session_lifetime' => 60 * 60 * 12,
  'session_keepalive' => true,
  'auto_logout' => true,
##'token_auth_enforced => true,
##'token_auth_activity_update => 60-300 Min.
  'auth.bruteforce.protection.enabled' => true,
##'auth.bruteforce.protection.force.database => true,
##'auth.webauthn.enabled => false,
##'versions_retention_obligation => auto, D1,
  'appcodechecker' => true,
##'updatechecker => false,
  'update.server.url' => 'https://updates.nextcloud.com/updater_server/',
  'updater.release.channel' => 'stable'
##'has_internet_connection => true,
##'check_for_working_htaccess => true,
##'config_is_read_only => false, (aktivieren wenn alle Konfiguarionen abgeschlossen sind)
##'appstoreenabled => false,
  'appstoreurl' => 'https://apps.nextcloud.com/api/v1',
##'enable_previews => false,
##'filesystem-cache-readonly => true,
  'gs.federation' => 'internal'
##'login_form_autocomplete => false;
  'login_form_timeout' => 150,
  'no_unsupported_browser_warning' => true,
  ),
  );

```

In the browser, he described an error to me and referred to the test.config.php. He gave me various errors in a few lines. He went through all the lines, but it only worked again after I had removed the test.config.php. 🤔

---

<div class="post-metadata">

**Author:** ![Vincent\_Stans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vincent_stans/32/17415_2.png) [@Vincent\_Stans](https://help.nextcloud.com/u/Vincent_Stans)\
**Post date:** [December 29, 2024, 5:09am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/2 "2024-12-29T05:09:07Z")

</div>

For as far as I can see

> [@sunny](#):
>
> ```auto
> 'skeletondirectory' =>
> 'templatedirectory' =>
> 
> ```

should be

```auto
 'skeletondirectory' => '',
 'templatedirectory' => '',

```

> [@sunny](#):
>
> ` 'updater.release.channel' => 'stable'`

missing comma

```auto
  'updater.release.channel' => 'stable',

```

> [@sunny](#):
>
> ` 'gs.federation' => 'internal'`

missing comma

```auto
  'gs.federation' => 'internal',

```

> [@sunny](#):
>
> ```auto
> ),
> );
> 
> ```

no opening bracket ( ), thus 1 too many

---

<div class="post-metadata">

**Author:** ![sunny](https://help.nextcloud.com/user_avatar/help.nextcloud.com/sunny/32/67562_2.png) [@sunny](https://help.nextcloud.com/u/sunny)\
**Post date:** [December 29, 2024, 5:16am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/3 "2024-12-29T05:16:15Z")

</div>

> [@Vincent\_Stans](#):
>
> ```auto
> 'skeletondirectory' => '',
> 'templatedirectory' => '',
> 
> ```

The documentation only says that you should leave it empty.

I’ll try the rest. It would be great if it was only because of that. 🫡

---

<div class="post-metadata">

**Author:** ![ernolf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ernolf/32/77874_2.png) [@ernolf](https://help.nextcloud.com/u/ernolf)\
**Post date:** [December 29, 2024, 5:44am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/4 "2024-12-29T05:44:19Z")

</div>

> [@sunny](#):
>
> Maybe you notice what could be wrong?

There is a lot which is wrong!

> [@sunny](#):
>
> ```php
> 'default_phone_region' => false,
> 
> ```

simply `false` as value is wrong, since this is not a boolean value:

```php
/**
 * This sets the default region for phone numbers on your Nextcloud server,
 * using ISO 3166-1 country codes such as ``DE`` for Germany, ``FR`` for France, …
 * It is required to allow inserting phone numbers in the user profiles starting
 * without the country code (e.g. +49 for Germany).
 *
 * No default value!
 */
'default_phone_region' => 'GB',

```

* * *

> [@sunny](#):
>
> ` 'knowledgebase.ambedded' => false,`

There is a typo ( → **a** ← mbedded)  
this should be

```php
  'knowledgebase.embedded' => false,

```

* * *

> [@sunny](#):
>
> ```php
> 'skeletondirectory' =>
> 'templatedirectory' =>
> 
> ```

There are no paths here. Paths must be entered as values ​​in quotes and lines must end with a comma.

* * *

> [@sunny](#):
>
> ```php
> 'remember_login_coockie_lifetime' => 60*60*24*15,
> 
> ```

There is a typo (coo → **c** ← kie)  
this should be:

```php
  'remember_login_cookie_lifetime' => 60*60*24*15,

```

* * *

> [@sunny](#):
>
> ```php
> ),
> 
> ```

This is used to close an array of values ​​that has not been opened before, so this closing bracket does not belong there.

That’s what I noticed immediately.

If possible, you shouldn’t edit the config.php directly, but [→ make the entries with **occ** as intended ←](https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html#config-commands-label). This avoids errors like these that were caused by brute force.

If you still have problems with occ, you could try the occ wrapper [→ **nc-occ** ←](https://help.nextcloud.com/t/script-nc-occ-interactive-occ-interface/195249), which builds the commands interactively with you and also works for Nextcloud All-In-One.

h.t.h.

* * *

Much and good luck,  
ernolf

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [December 29, 2024, 8:59pm UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/5 "2024-12-29T20:59:59Z")

</div>

> [@sunny](#):
>
> unfortunately there were errors.

Next time post the errors. 😉

I would also urge you to use `occ config:list system` as noted on the docs to see your actual parsed configuration.

See [here](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#modifying).

---

<div class="post-metadata">

**Author:** ![sunny](https://help.nextcloud.com/user_avatar/help.nextcloud.com/sunny/32/67562_2.png) [@sunny](https://help.nextcloud.com/u/sunny)\
**Post date:** [December 30, 2024, 1:48am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/6 "2024-12-30T01:48:09Z")

</div>

> [@ernolf](#):
>
> If you still have problems with occ, you could try the occ wrapper [→ **nc-occ** ←](https://help.nextcloud.com/t/script-nc-occ-interactive-occ-interface/195249), which builds the commands interactively with you and also works for Nextcloud All-In-One.

I haven’t managed to use `occ` so far. I don’t know from which path I am allowed to use this command? I read a thread here where the same thing happened to someone. I think that’s because of AIO. I can’t find a php version on my Debian server either. Maybe that’s the reason why `occ` doesn’t work? I haven’t installed php yet, I wanted to wait until I know more.

Without php installed, the config.php should work at all?

> [@ernolf](#):
>
> There is a lot which is wrong!

That’s really embarrassing. But it was the first attempt. Thank you for the correction.

> [@jtr](#):
>
> Next time post the errors. 😉

I’m happy to do that. It was simply a warning in the browser that pointed to the lines in the test.config.php that seemed to contain an error. But I had to deactivate everything first before it worked again.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [December 30, 2024, 2:04am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/7 "2024-12-30T02:04:41Z")

</div>

> [@sunny](#):
>
> I haven’t managed to use `occ` so far. I don’t know from which path I am allowed to use this command? I read a thread here where the same thing happened to someone. I think that’s because of AIO.

[AIO: How to run occ commands](https://github.com/nextcloud/all-in-one#how-to-run-occ-commands)

---

<div class="post-metadata">

**Author:** ![sunny](https://help.nextcloud.com/user_avatar/help.nextcloud.com/sunny/32/67562_2.png) [@sunny](https://help.nextcloud.com/u/sunny)\
**Post date:** [December 31, 2024, 3:01am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/8 "2024-12-31T03:01:09Z")

</div>

So I have now tested it without variables.  
The test.config.php only says:

```auto
<?php
$CONFIG = array (
),

```

So it is almost completely empty. There is an error in the browser, as follows:

```auto
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the webserver log.
<br />
<b>Parse error</b>: syntax error, unexpected token &quot;,&quot; in <b>/var/www/html/config/test.config.php</b> on line <b>5</b><br />

```

So something else must be wrong.  
Line 5 is the `),`

My `occ config:list system` with out the testing.conf.php

```auto
{

    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": " ***REMOVED SENSITIVE VALUE***",
            "password": " ***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "mydomain",
        "overwriteprotocol": "https",
        "passwordsalt": " ***REMOVED SENSITIVE VALUE***",
        "secret": " ***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "mydomain"
        ],
        "datadirectory": " ***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.4.1",
        "overwrite.cli.url": "https:\/\/mydomain\/",
	"dbname": " ***REMOVED SENSITIVE VALUE***",
        "dbhost": " ***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": " ***REMOVED SENSITIVE VALUE***",
        "dbpassword": " ***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": " ***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "loglevel": 3,
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita",
            "0": "OC\\Preview\\Imaginary",
            "23": "OC\\Preview\\ImaginaryPDF"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",

        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "updatedirectory": "\/nc-updater",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": " ***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": " ***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": " ***REMOVED SENSITIVE VALUE***",
        "defaultapp": "dashboard,spreed,files",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": " ***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_from_address": " ***REMOVED SENSITIVE VALUE***",
        "mail_domain": " ***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpname": " ***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": " ***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [
            "dokuwiki",
            "apporder"
        ],
        "DOMAIN": "mydomain
}

```

And that’s my `occ config:list system` with the empty `test.config.php`

```auto
An unhandled exception has been thrown:
ParseError: syntax error, unexpected token "," in /var/www/html/config/empty.config.php:5
Stack trace:
#0 /var/www/html/lib/private/Config.php(40): OC\Config->readData()
#1 /var/www/html/lib/base.php(89): OC\Config->__construct('/var/www/html/c...')
#2 /var/www/html/lib/base.php(571): OC::initPaths()
#3 /var/www/html/lib/base.php(1134): OC::init()
#4 /var/www/html/console.php(28): require_once('/var/www/html/l...')
#5 /var/www/html/occ(11): require_once('/var/www/html/c...')

```

And without the comma on line 5, there is the same error. Even without brackets there is the error. Only when I remove the additional config.php does it work again.

I guess I’m not allowed to just write the variables raw in the config but always need the:

```auto
<?php
$CONFIG = array (
),

```

I’ll try that out tomorrow. But I thought I had to be there?

---

<div class="post-metadata">

**Author:** ![ernolf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ernolf/32/77874_2.png) [@ernolf](https://help.nextcloud.com/u/ernolf)\
**Post date:** [December 31, 2024, 6:32am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/9 "2024-12-31T06:32:09Z")

</div>

> [@sunny](#):
>
> ```auto
> <?php
> $CONFIG = array (
> ),
> 
> ```

It must be terminated with a ; instead of a ,

So it should be

```auto
<?php
$CONFIG = array (
);

```

h.t.h.

* * *

Much and good luck,  
ernolf

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [March 31, 2025, 6:32am UTC](https://help.nextcloud.com/t/what-is-wrong-about-my-config-php/213604/10 "2025-03-31T06:32:34Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
