I think it is not a good idea to use Nextcloud in webspace. There are a lot of also free Nextcloud hosters and if you trust your webspace provider you can also trust a Managed Nextcloud provider.
In older versions (till Nextcloud 18) there was an app OCC Web. But i do not know if it still works in Nextcloud 23. Also - if you can use cron jobs you can perhaps use cron to execute the command.
Some php installations also allow exec from shell. But i think that is not possible on your webspace. Then you can test this php file:
How to (re)scan files without command line access? - #10 by Tihnk