PHP OPcache-Module configuration and missing database indices


I have set up Nextcloud on a webspace that natively supports NC ( I should also mention that I have absolutely no idea what I’m doing btw.

After setup, the settings overview tells me to configure OPcache-module; opcache.memory_consumption shall be set over 128 and opcache.interned_strings_buffer shall be set over 8.

I have no access to the php.ini so I added to the .user.ini that was already in the Nextcloud main folder:


And to the .htaccess that also was there I added:

php_value opcache.memory_consumption 160
php_value opcache.interned_strings_buffer 16

However, the error is still shown. Did I do it wrong? Or do I have to ask the provider to edit the php.ini?

Also, settings overview tells me that some indices are missing in the database:
The table nc_filecache is missing the index fs_parent and the table nc_mounts is missing the index mounts_user_root_path_index.

I have to execute occ db:add-missing-indices, however, I have no access to the server’s console. Can I create these indexes manually? Is there any other way to create these entries?

Thanks in advance,

Hi @Grom

Three things come to mind about this topic:

  1. I would not recommend using Nextcloud on a shared webhosting platform, because they have usually some limitations like small cache sizes, low PHP memory Limit, Low Post / Upload Max Filesizes etc… and Nextcloud would like to have as much as possible of everything in order to run well. And there’s of course the lack of SSH access, especially with the cheap plans.

  2. if you absolutely need to use shared hosting, pay at least the extra Euros for a plan that offers SSH access. Have the hosting provider assure you that you can run PHP scripts from the console, because it will be necessary to run occ commands every now and then.

  3. As a workaround for now, you could try to set up a one time cronjob in the web control panel of your hosting provider, in order to execute the ooc command.