On some hosters it is possible to use a separate PHP-file to perform occ commands. It depends on the settings of the hoster though, whether that will work or not (it works with mine). It might be worth a try:
- create a file on your webspace called
occ-command.php(or whatever you wanna call it) with the following content (adjustRELATIVE/PATH/TO/occto point to youroccin the nextcloud-installation folder; also the path tophppossibly needs to be adjusted):<?php exec("/usr/bin/php -d memory_limit=1024M RELATIVE/PATH/TO/occ -n status > occ_result.txt"); exec("echo \"Command completed!\" >> occ-result.txt 2>&1"); header('Location: occ-result.txt'); ?> - visit
occ-command.phpwith a browser - after executing the command, the browser will be redirected to a logfile (
occ-result.txt) - some providers block the php-function
exec. If that is the case, you can try to replaceexecwithpassthru,systemorshell_exec. - for security reasons it is better to delete
occ-command.phpandocc-result.txtfrom your webserver when you are done.