Fatal error: Uncaught Error: Class 'OCP\User' not found

i just install Next cloud on my server and i am trying to activate onlyoffice app but unfortunately i have some errore messages:

  1. when i try to open a word documents show this error: ONLYOFFICE cannot be reached. Please contact admin.
  2. When i am trying to reach onlyoffice/settings.php" gives following errore:

Fatal error: Uncaught Error: Class ‘OCP\User’ not found in mysite.eu/cloud/apps/onlyoffice/settings.php:34 Stack trace: #0 {main} thrown in mysite.eu/cloud/apps/onlyoffice/settings.php on line 34.

And settings.php on line 34 look like:


namespace OCA\Onlyoffice;

use OCP\User;

use OCA\Onlyoffice\AppInfo\Application;
use OCA\Onlyoffice\Controller\SettingsController;


$app = new Application();
$container = $app->getContainer();
$response = $container->query(SettingsController::class)->index();

return $response->render();

Any help please. Thank you.