Upgrading NextCloud on PLESK Server

I encountered timeouts and problems with the web updater of NextCloud. Since it is super easy to use the command line updater and nothing like that has appeared here I think this is the way to go. I run a root server with PLESK. I use PHP 7.3 installed via plesk for the cloud subdomain.

Here are all the commands:

Change directory to wherever your NextCloud installation is located:

[code] cd /var/www/vhosts/DOMAIN/cloud [/code]

Your USER would be www-data or the owner of the domain in PLESK:

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php updater/updater.phar
[/code]

Say “yes” to start the upgrade.

Say no here! The system php maybe different from the one used by Plesk.

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php occ upgrade
[/code]

This checks if some maintenance on db side (not indexed columns) needs to be taken care of.

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php ./occ db:add-missing-indices
[/code]

Then switch off the maintenance mode.

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php occ maintenance:mode –off
[/code]

Running Custom PHP Modules in Plesk on an Ubuntu Server: MemCached

This article is inspired by https://devblog.plesk.com/2015/08/adding-custom-php-modules-in-plesk/. It was written for CentOs/Fedora/RedHat servers having yum instead of apt. I run Ubuntu 12.04 LTS on a virtual server. Among other applications I host WordPress and OwnCloud here. Plesk allows to use newer PHP versions (5.6.x and 7.0.x) instead of the dated one (5.4.x) that comes with my old Ubuntu.
No MemCached module available
No MemCached module available
Here are the necessary steps:
  1. Install required packages to compile modules for PHP
    $ apt-get install gcc build-essential plesk-php56-dev plesk-php70-dev libmemcached-dev libmemcache0 zlib1g-dev

    Be aware that there may be some other packages that you need to install that I did not list here since they probably were already installed on my server. If you run into missing headers this might be an indicator for that.

  1. Install the memcached module:
    $ /opt/plesk/php/5.6/bin/pecl install memcached
  2.  You will be asked for the “libmemcached directory [no] :”
    The default is “no”. If you have no need for sasl answer:

    no --disable-memcached-sasl

    If you need memcached with sasl2 support you can install it manually following this advice.

  3. After the installation is finished you need to register the module with Plesk:
    $ echo "extension=memcached.so" > /opt/plesk/php/5.6/etc/php.d/memcached.ini
    $ plesk bin php_handler --reread
MemCached module available
MemCached module available