Thank you for the answers. As I understand what needs to be done is that the occ command needs to be executed by getting the webserver (in my case, 1and1’s Apache server) for the command to be effective.
Here’s what I did, using the suggestions. I am at the limit of my understanding / not understanding of how all of this works so comments on how to improve what I did are welcomed.
I modified my .htaccess file with the following:
AddHandler cgi-script .sh
This allows shell scripts to be executed from the browser and my source for this information was from here:
I then used the suggested shell script and created a file “fixindex.sh” in my nextcloud root directory.:
echo Content-Type: text/plain
echo Attempting to run occ
nohup /usr/bin/php7.1-cli /full_path_to_your_website/nextcloud/occ db:add-missing-indices
echo Initiated attempted resulted in exit code $?
To make the script executable, I changed the permissions to 755:
chmod 755 fixindex.sh
To determine my path for my website, I used pwd. For 1and1, it takes the form of:
I then went to my browser and executed:
The browser returned
Attempting to run occ
Initiated attempted resulted in exit code 127
I tired to troubleshoot why I was getting an exit code of 127 which is when a command is not found within your
PATH but could not eliminate the error message.
Oddly enough, the Administrative panel of Nextcloud no longer says there are missing indexes so it is a mystery to me as to how the command ran correctly even though I was receiving the error code.
Again, I appreciate the help and what is generally useful is that I now have a method for running occ commands without having command line ability to run as the HTTP user.
Does anyone know how the command ran even though I was obtaining an error code that it wasn’t?