Nextcloud version: 20.0.4
Operating system and version: Debian GNU/Linux 10 (buster) - 1&1 Ionos Shared Hosting (!)
Apache or nginx version: unclear, commands to check don’t work
PHP version: 7.4
Nextcloud shows various issues with missing indices, keys, etc. It tells me to use occ command to fix those. OCC command execution causes immediate error.
I am on a shared hoster. I have SSH access, but NO sudo access. I can execute occ only by going into nextcloud/ directory and running it via ./occ, occ itself is not found as a command.
The Nextcloud version was just updated to the latest version, no change in behavior.
Steps to replicate it:
- Go to installation directory nextcloud/
X-Powered-By: PHP/4.4.9 Content-type: text/html <br /> <b>Fatal error</b>: main() [<a href='function.require'>function.require</a>]: Failed opening required '__DIR__/console.php' (include_path='.:/usr/lib/php4.4') in <b>/homepages/13/d13526801/htdocs/nextcloud/occ</b> on line <b>11</b><br />
console.php file exists in the same directory as occ file. After I changed occ file import path to ‘console.php’ without
__DIR__ , that error no longer appears, but the next comes immediately:
X-Powered-By: PHP/4.4.9 Content-type: text/html <br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in <b>/homepages/13/d13526801/htdocs/nextcloud/console.php</b> on line <b>38</b><br /> (
That line is also one where
__DIR__ is used, so I assume that this is not supported? Maybe there is a simple workaround by setting this constant myself or something?
define(__DIR__, "/homepages/13/d13526801/htdocs/nextcloud"); in OCC file, but that only fixed the first error, the second error in console.php still appears, so I assume that define() does not work globally.
Is there a way to set this globally or via command, I tried
__DIR__=/homepages/13/d13526801/htdocs/nextcloud ./occ db:add-missing-indices
but that changed nothing.
But I am not a linux expert so no idea how this is done “right”. Any help would be appreciated.
The output of your Nextcloud log in Admin > Logging: Nothing at all is added to log after executing the command
The output of your config.php file in
/path/to/nextcloud (make sure you remove any identifiable information!):
<?php $CONFIG = array ( 'instanceid' => '<redacted>', 'passwordsalt' => '<redacted>', 'secret' => '<redacted>', 'trusted_domains' => array ( 0 => '<redacted>' ), 'datadirectory' => '/homepages/13/d13526801/htdocs/nextcloud-data', 'overwrite.cli.url' => '<redacted>', 'dbtype' => 'mysql', 'version' => '126.96.36.199', 'dbname' => '<redacted>', 'dbhost' => '<redacted>', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => '<redacted>', 'dbpassword' => '<redacted>', 'logtimezone' => 'UTC', 'installed' => true, 'theme' => '', 'maintenance' => false, 'loglevel' => 2, 'updater.release.channel' => 'stable', 'updater.secret' => '<redacted>', );
The output of your Apache/nginx/system log in
Cannot find the directory, probably no access due to shared hosting restrictions.
I have a logs/ directory, but nothing is added after failed command execution.