Changing admin password

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

by following this link

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/
Stack trace:
#0 /home/sites/site100012839/web/ OC\AppFramework\Http\Request->getScriptName()
#1 /home/sites/site100012839/web/ OC::initPaths()
#2 /home/sites/site100012839/web/ OC::init()
#3 /home/sites/site100012839/web/ require_once(’/home/sites/sit…’)
#4 /home/sites/site100012839/web/ 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/****

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

Post new errors.

€: Done. thanks for help.