Hey everyone! I’m running into an error which I’m hoping to get your insight on:
/app # frankenphp php-cli occ files:scan
An unhandled exception has been thrown:
Exception: Config file has leading content, please remove everything before "<?php" in config.php in /app/lib/private/Config.php:257
Stack trace:
#0 /app/lib/private/Config.php(71): OC\Config->readData()
#1 /app/lib/base.php(150): OC\Config->__construct('/app/config/')
#2 /app/lib/base.php(622): OC::initPaths()
#3 /app/lib/base.php(1181): OC::init()
#4 /app/console.php(48): require_once('/app/lib/base.p...')
#5 /app/occ(11): require_once('/app/console.ph...')
I’ve just SCPed over the contents of my old Snap-based nextcloud instance which I’d like to retire in favour of my own Docker-based solution. I’ve built it using a Caddy module called FrankenPHP running in one container and a Postgres instance in another. I ran through the installation using the provided occ
script, which worked well.
I encountered this issue during setup numerous times, but was able to resolve it each time by simply deleting the config file and running frankenphp php-cli occ maintainence:install
again with the configuration I’d like, but I don’t have that luxury anymore since I’d like to keep my current config.
The curious thing is that the error reports leading content before the <?php
section in the main config file, but there isn’t anything there. This thread seems to suggest hidden characters, but hexdump
ing the contents of my config file proves there’s nothing there.
I’m hoping for extra help. Here’s my config.php
<?php
$CONFIG = array (
'passwordsalt' => '/* redacted */',
'secret' => '/* redacted */',
'trusted_domains' =>
array (
0 => 'nextcloud./*my domain*/',
),
'datadirectory' => '/user',
'dbtype' => 'pgsql',
'version' => '29.0.1.1',
'overwrite.cli.url' => 'http://nextcloud./*my domain*/',
'dbname' => 'nextcloud',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'oc_/*user*/',
'dbpassword' => '/* redacted */',
'installed' => true,
'instanceid' => 'ochw1if5x1yo',
'openssl' =>
array (
'config' => '/app/3rdparty/phpseclib/phpseclib/phpseclib/openssl.cnf',
),
'twofactor_enforced' => 'true',
'twofactor_enforced_groups' =>
array (
0 => 'admin',
),
'twofactor_enforced_excluded_groups' =>
array (
),
'app_install_overwrite' =>
array (
0 => 'cms_pico',
),
'app.mail.imap.timeout' => 20,
'app.mail.smtp.timeout' => 20,
'app.mail.sieve.timeout' => 20,
'app.mail.verify-tls-peer' => false,
);
?>
Another frustrating thing is that despite the occ
script not working, the instance itself seems to be fine, and use/interpret the config as expected.
Any ideas what the cause/solution could be? Let me know if you’d like me to post my docker-compose.yaml
file