Changing admin password

Hello ive been trying to change the lost admin password for my nextcloud. ive tried trought sudo

by following this link https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/reset_admin_password.html

but i allways get errors with every php version i am trying to use.

An unhandled exception has been thrown:
TypeError: Return value of OC\AppFramework\Http\Request::getScriptName() must be of the type string, null returned in /home/sites/site100012839/web/-cloud.de/lib/private/AppFramework/Http/Request.php:838
Stack trace:
#0 /home/sites/site100012839/web/
-cloud.de/lib/base.php(154): OC\AppFramework\Http\Request->getScriptName()
#1 /home/sites/site100012839/web/-cloud.de/lib/base.php(591): OC::initPaths()
#2 /home/sites/site100012839/web/
-cloud.de/lib/base.php(1068): OC::init()
#3 /home/sites/site100012839/web/-cloud.de/console.php(46): require_once(’/home/sites/sit…’)
#4 /home/sites/site100012839/web/
-cloud.de/occ(10): require_once(’/home/sites/sit…’)

is there any other way to change or retrieve the password? i am failing every attempt.

there is no other admin users i cant ask any1 to change it. also sending email dont work…

Hopefully there is only a directory path problem.

Perhaps you can execute “occ” in the correct dir:

Go to the directory:
cd ****/home/sites/site100012839/web/****-cloud.de

Then:
sudo username php ./occ user:resetpassword admin
or only
php ./occ user:resetpassword admin

Post new errors.

€: Done. thanks for help.