Migration to another server & switch from Apache to Nginx not smooth

Migration to another server & switch from Apache to Nginx not smooth
Moved nextcloud to another FreeBSD server away from Apache to Nginx php-fpm
currently getting a page saying

Internal Server Error

The server encountered an internal error and was unable to complete your request. 
Please contact the server administrator if this error reappears multiple times, 
please include the technical details below in your report.
More details can be found in the server log.

‘dbtype’ => ‘sqlite3’,
‘version’ => ‘3.20.1’,
Nextcloud version _12.0.3.3:
Operating system and version FreeBSD 11.1p1:
Apache or nginx version Nginx 1.12.2:
PHP version FPM FastCGI PHP Version 5.6.31:
Is this the first time you’ve seen this error?: Yes

Can you reliably replicate it? Moved nextcloud to another FreeBSD server away from Apache to Nginx php-fpm

The issue you are facing:
Lots of errors, am unable to disable possible offending apps/plugins

The output of your Nextcloud log in **Admin > Logging**:

{“reqId”:“HxMS5Ai4dlixnWRuAVbB”,“level”:3,“time”:“2017-10-30T21:00:01+00:00”,“remoteAddr”:“91.115.51.7”,“user”:“–”,“app”:“index”,“method”:“GET”,“url”:“/thera/”,“message”:"Exception: {"Exception":"Doctrine\\DBAL\\Exception\\TableNotFoundException","Message":"An exception occurred while executing ‘SELECT * FROM \"oc_appconfig\"’:\n\nSQLSTATE[HY000]: General error: 1 no such table: oc_appconfig","Code":0,"Trace":"#0 \/usr\/local\/www\/apache24\/data\/thera\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractSQLiteDriver->convertException(‘An exception oc…’, Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \/usr\/local\/www\/apache24\/data\/thera\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(855): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOSqlite\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), ‘SELECT * FROM \"…’, Array)\n#2

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'removed',
  'passwordsalt' => 'removed',
  'secret' => 'removed',
  'trusted_domains' =>
  array (
    0 => 'www.domain.org',
  ),
  'datadirectory' => '/usr/local/www/apache24/data/nc',
  'overwrite.cli.url' => 'https://www.domain.org/nc',
  'dbtype' => 'sqlite3',
  'version' => '12.0.3.3',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'theme' => '',
  'loglevel' => 0,
  'mail_smtpmode' => 'php',
  'mail_smtphost' => 'domain.org',
  'mail_smtpsecure' => 'tls',
  'mail_from_address' => 'domain-noreply',
  'mail_domain' => 'domain.org',
  'mail_smtpport' => '587',
);

**Nginx config:**

nginx version: nginx/1.12.2
built with OpenSSL 1.0.2l 25 May 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt=‘-I /usr/local/include’ --with-ld-opt=‘-L /usr/local/lib’ --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --user=www --group=www --modules-path=/usr/local/libexec/nginx --with-file-aio --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx/access.log --add-module=/usr/ports/www/nginx/work/nginx_accept_language_module-2f69842 --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --add-module=/usr/ports/www/nginx/work/nginx-dav-ext-module-0.0.3 --add-dynamic-module=/usr/ports/www/nginx/work/ngx-fancyindex-0.4.1 --add-module=/usr/ports/www/nginx/work/nginx-http-footer-filter-1.2.2 --add-dynamic-module=/usr/ports/www/nginx/work/ngx_http_geoip2_module-2.0 --with-http_flv_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_mp4_module --add-module=/usr/ports/www/nginx/work/nginx_mod_h264_streaming-2.2.7 --with-http_perl_module=dynamic --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_stub_status_module --with-http_sub_module --add-module=/usr/ports/www/nginx/work/nginx-upload-module-72ec037 --add-module=/usr/ports/www/nginx/work/nginx-upload-progress-module-0.9.0 --add-module=/usr/ports/www/nginx/work/nginx-video-thumbextractor-module-0.7.0 --add-module=/usr/ports/www/nginx/work/mod_zip-74ef235 --add-module=/usr/ports/www/nginx/work/ngx_devel_kit-0.3.0 --add-module=/usr/ports/www/nginx/work/encrypted-session-nginx-module-0.06 --add-dynamic-module=/usr/ports/www/nginx/work/memc-nginx-module-0.18 --with-pcre --with-http_v2_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads --with-mail=dynamic --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --with-mail_ssl_module --with-http_ssl_module --add-module=/usr/ports/www/nginx/work/iconv-nginx-module-0.14

PHP:

‘./configure’ ‘–with-layout=GNU’ ‘–localstatedir=/var’ ‘–with-config-file-scan-dir=/usr/local/etc/php’ ‘–disable-all’ ‘–enable-libxml’ ‘–enable-mysqlnd’ ‘–with-libxml-dir=/usr/local’ ‘–with-pcre-regex=/usr/local’ ‘–with-zlib-dir=/usr’ ‘–program-prefix=’ ‘–enable-fpm’ ‘–with-fpm-user=www’ ‘–with-fpm-group=www’ ‘–with-regex=php’ ‘–with-zend-vm=CALL’ ‘–prefix=/usr/local’ ‘–mandir=/usr/local/man’ ‘–infodir=/usr/local/info/’ ‘–build=amd64-portbld-freebsd11.1’ ‘build_alias=amd64-portbld-freebsd11.1’ ‘CC=cc’ ‘CFLAGS=-O2 ‘-pipe’ ‘-fstack-protector’ ‘-fno-strict-aliasing’’ ‘LDFLAGS= ‘-fstack-protector’’ ‘LIBS=-lpthread’ ‘CPPFLAGS=’ ‘CPP=cpp’ ‘CXX=c++’ 'CXXFLAGS=-O2 ‘-pipe’ ‘-fstack-protector’ ‘-fno-strict-aliasing’

/usr/local/etc/php/ext-10-opcache.ini, /usr/local/etc/php/ext-18-session.ini, /usr/local/etc/php/ext-20-bcmath.ini, /usr/local/etc/php/ext-20-bz2.ini, /usr/local/etc/php/ext-20-calendar.ini, /usr/local/etc/php/ext-20-ctype.ini, /usr/local/etc/php/ext-20-curl.ini, /usr/local/etc/php/ext-20-dom.ini, /usr/local/etc/php/ext-20-exif.ini, /usr/local/etc/php/ext-20-fileinfo.ini, /usr/local/etc/php/ext-20-filter.ini, /usr/local/etc/php/ext-20-ftp.ini, /usr/local/etc/php/ext-20-gd.ini, /usr/local/etc/php/ext-20-gettext.ini, /usr/local/etc/php/ext-20-hash.ini, /usr/local/etc/php/ext-20-iconv.ini, /usr/local/etc/php/ext-20-imap.ini, /usr/local/etc/php/ext-20-intl.ini, /usr/local/etc/php/ext-20-json.ini, /usr/local/etc/php/ext-20-ldap.ini, /usr/local/etc/php/ext-20-mbstring.ini, /usr/local/etc/php/ext-20-mcrypt.ini, /usr/local/etc/php/ext-20-mysql.ini, /usr/local/etc/php/ext-20-mysqli.ini, /usr/local/etc/php/ext-20-openssl.ini, /usr/local/etc/php/ext-20-pcntl.ini, /usr/local/etc/php/ext-20-pdo.ini, /usr/local/etc/php/ext-20-posix.ini, /usr/local/etc/php/ext-20-pspell.ini, /usr/local/etc/php/ext-20-simplexml.ini, /usr/local/etc/php/ext-20-sockets.ini, /usr/local/etc/php/ext-20-sqlite3.ini, /usr/local/etc/php/ext-20-tidy.ini, /usr/local/etc/php/ext-20-tokenizer.ini, /usr/local/etc/php/ext-20-xml.ini, /usr/local/etc/php/ext-20-xmlwriter.ini, /usr/local/etc/php/ext-20-zip.ini, /usr/local/etc/php/ext-20-zlib.ini, /usr/local/etc/php/ext-30-pdf.ini, /usr/local/etc/php/ext-30-pdo_mysql.ini, /usr/local/etc/php/ext-30-pdo_sqlite.ini, /usr/local/etc/php/ext-30-phar.ini, /usr/local/etc/php/ext-30-scrypt.ini, /usr/local/etc/php/ext-30-wddx.ini, /usr/local/etc/php/ext-30-xmlreader.ini, /usr/local/etc/php/ext-30-xmlrpc.ini, /usr/local/etc/php/ext-30-xsl.ini

The output of your Apache/nginx/system log in `/var/log/____`:

Actually what was interesting was the output of occ
# sudo -u www php occ

An unhandled exception has been thrown:
exception ‘PDOException’ with message ‘SQLSTATE[HY000]: General error: 1 no such table: oc_appconfig’ in /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104
Stack trace:
#0 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query(‘SELECT * FROM "…’)
#1 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query(‘SELECT * FROM "…’)
#2 /usr/local/www/apache24/data/thera/lib/private/DB/Connection.php(192): Doctrine\DBAL\Connection->executeQuery(‘SELECT * FROM "…’, Array, Array, NULL)
#3 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery(‘SELECT * FROM `…’, Array, Array)
#4 /usr/local/www/apache24/data/thera/lib/private/DB/QueryBuilder/QueryBuilder.php(213): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(318): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(94): OC\AppConfig->loadConfigValues()
#7 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(277): OC\AppConfig->getApps()
#8 /usr/local/www/apache24/data/thera/lib/private/legacy/app.php(970): OC\AppConfig->getValues(false, ‘installed_versi…’)
#9 /usr/local/www/apache24/data/thera/lib/private/Server.php(458): OC_App::getAppVersions()
#10 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#11 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘OC\Memcache\Fac…’)
#12 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘OC\Memcache\Fac…’)
#13 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query(‘OC\Memcache\Fac…’)
#14 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#15 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘MemCacheFactory’)
#16 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘MemCacheFactory’)
#17 /usr/local/www/apache24/data/thera/lib/private/Server.php(1326): OC\ServerContainer->query(‘MemCacheFactory’)
#18 /usr/local/www/apache24/data/thera/lib/private/Server.php(651): OC\Server->getMemCacheFactory()
#19 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#20 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘OC\App\AppManag…’)
#21 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘OC\App\AppManag…’)
#22 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query(‘OC\App\AppManag…’)
#23 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#24 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘AppManager’)
#25 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘AppManager’)
#26 /usr/local/www/apache24/data/thera/lib/private/Server.php(1518): OC\ServerContainer->query(‘AppManager’)
#27 /usr/local/www/apache24/data/thera/lib/private/legacy/app.php(315): OC\Server->getAppManager()
#28 /usr/local/www/apache24/data/thera/lib/private/legacy/util.php(1481): OC_App::getEnabledApps(false, true)
#29 /usr/local/www/apache24/data/thera/lib/public/Util.php(706): OC_Util::needUpgrade(Object(OC\SystemConfig))
#30 /usr/local/www/apache24/data/thera/lib/base.php(295): OCP\Util::needUpgrade()
#31 /usr/local/www/apache24/data/thera/lib/base.php(742): OC::checkUpgrade(false)
#32 /usr/local/www/apache24/data/thera/lib/base.php(1086): OC::init()
#33 /usr/local/www/apache24/data/thera/console.php(56): require_once(‘/usr/local/www/…’)
#34 /usr/local/www/apache24/data/thera/occ(11): require_once(‘/usr/local/www/…’)
#35 {main}

Next exception ‘Doctrine\DBAL\Driver\PDOException’ with message ‘SQLSTATE[HY000]: General error: 1 no such table: oc_appconfig’ in /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:106
Stack trace:
#0 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query(‘SELECT * FROM "…’)
#1 /usr/local/www/apache24/data/thera/lib/private/DB/Connection.php(192): Doctrine\DBAL\Connection->executeQuery(‘SELECT * FROM "…’, Array, Array, NULL)
#2 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery(‘SELECT * FROM `…’, Array, Array)
#3 /usr/local/www/apache24/data/thera/lib/private/DB/QueryBuilder/QueryBuilder.php(213): Doctrine\DBAL\Query\QueryBuilder->execute()
#4 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(318): OC\DB\QueryBuilder\QueryBuilder->execute()
#5 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(94): OC\AppConfig->loadConfigValues()
#6 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(277): OC\AppConfig->getApps()
#7 /usr/local/www/apache24/data/thera/lib/private/legacy/app.php(970): OC\AppConfig->getValues(false, ‘installed_versi…’)
#8 /usr/local/www/apache24/data/thera/lib/private/Server.php(458): OC_App::getAppVersions()
#9 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#10 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘OC\Memcache\Fac…’)
#11 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘OC\Memcache\Fac…’)
#12 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query(‘OC\Memcache\Fac…’)
#13 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#14 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘MemCacheFactory’)
#15 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘MemCacheFactory’)
#16 /usr/local/www/apache24/data/thera/lib/private/Server.php(1326): OC\ServerContainer->query(‘MemCacheFactory’)
#17 /usr/local/www/apache24/data/thera/lib/private/Server.php(651): OC\Server->getMemCacheFactory()
#18 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#19 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘OC\App\AppManag…’)
#20 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘OC\App\AppManag…’)
#21 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query(‘OC\App\AppManag…’)
#22 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#23 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘AppManager’)
#24 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘AppManager’)
#25 /usr/local/www/apache24/data/thera/lib/private/Server.php(1518): OC\ServerContainer->query(‘AppManager’)
#26 /usr/local/www/apache24/data/thera/lib/private/legacy/app.php(315): OC\Server->getAppManager()
#27 /usr/local/www/apache24/data/thera/lib/private/legacy/util.php(1481): OC_App::getEnabledApps(false, true)
#28 /usr/local/www/apache24/data/thera/lib/public/Util.php(706): OC_Util::needUpgrade(Object(OC\SystemConfig))
#29 /usr/local/www/apache24/data/thera/lib/base.php(295): OCP\Util::needUpgrade()
#30 /usr/local/www/apache24/data/thera/lib/base.php(742): OC::checkUpgrade(false)
#31 /usr/local/www/apache24/data/thera/lib/base.php(1086): OC::init()
#32 /usr/local/www/apache24/data/thera/console.php(56): require_once(‘/usr/local/www/…’)
#33 /usr/local/www/apache24/data/thera/occ(11): require_once(‘/usr/local/www/…’)
#34 {main}

Next exception ‘Doctrine\DBAL\Exception\TableNotFoundException’ with message 'An exception occurred while executing ‘SELECT * FROM “oc_appconfig”’:

SQLSTATE[HY000]: General error: 1 no such table: oc_appconfig’ in /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php:58
Stack trace:
#0 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractSQLiteDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))
#1 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(855): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOSqlite\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘SELECT * FROM "…’, Array)
#2 /usr/local/www/apache24/data/thera/lib/private/DB/Connection.php(192): Doctrine\DBAL\Connection->executeQuery(‘SELECT * FROM "…’, Array, Array, NULL)
#3 /usr/local/www/apache24/data/thera/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery(‘SELECT * FROM `…’, Array, Array)
#4 /usr/local/www/apache24/data/thera/lib/private/DB/QueryBuilder/QueryBuilder.php(213): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(318): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(94): OC\AppConfig->loadConfigValues()
#7 /usr/local/www/apache24/data/thera/lib/private/AppConfig.php(277): OC\AppConfig->getApps()
#8 /usr/local/www/apache24/data/thera/lib/private/legacy/app.php(970): OC\AppConfig->getValues(false, ‘installed_versi…’)
#9 /usr/local/www/apache24/data/thera/lib/private/Server.php(458): OC_App::getAppVersions()
#10 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#11 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘OC\Memcache\Fac…’)
#12 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘OC\Memcache\Fac…’)
#13 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query(‘OC\Memcache\Fac…’)
#14 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#15 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘MemCacheFactory’)
#16 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘MemCacheFactory’)
#17 /usr/local/www/apache24/data/thera/lib/private/Server.php(1326): OC\ServerContainer->query(‘MemCacheFactory’)
#18 /usr/local/www/apache24/data/thera/lib/private/Server.php(651): OC\Server->getMemCacheFactory()
#19 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#20 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘OC\App\AppManag…’)
#21 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘OC\App\AppManag…’)
#22 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query(‘OC\App\AppManag…’)
#23 /usr/local/www/apache24/data/thera/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#24 /usr/local/www/apache24/data/thera/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet(‘AppManager’)
#25 /usr/local/www/apache24/data/thera/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query(‘AppManager’)
#26 /usr/local/www/apache24/data/thera/lib/private/Server.php(1518): OC\ServerContainer->query(‘AppManager’)
#27 /usr/local/www/apache24/data/thera/lib/private/legacy/app.php(315): OC\Server->getAppManager()
#28 /usr/local/www/apache24/data/thera/lib/private/legacy/util.php(1481): OC_App::getEnabledApps(false, true)
#29 /usr/local/www/apache24/data/thera/lib/public/Util.php(706): OC_Util::needUpgrade(Object(OC\SystemConfig))
#30 /usr/local/www/apache24/data/thera/lib/base.php(295): OCP\Util::needUpgrade()
#31 /usr/local/www/apache24/data/thera/lib/base.php(742): OC::checkUpgrade(false)
#32 /usr/local/www/apache24/data/thera/lib/base.php(1086): OC::init()
#33 /usr/local/www/apache24/data/thera/console.php(56): require_once(‘/usr/local/www/…’)
#34 /usr/local/www/apache24/data/thera/occ(11): require_once(‘/usr/local/www/…’)


I can get you my configs later tonight. I have an identical setup at home right now. First, scrap PHP 5.6 for 7.1

You’ll need to compile APCu from ports for memcaching, as FreeBSD 11.1 still uses PHP56 as its default. Because of that, you’ll need to make the /etc/make.conf file with these contents:
DEFAULT_VERSIONS+= php7.1

Tonight, I’ll strip out confidential strings from my configs and give you my versions of PHP-FPM, php.ini and nginx.conf that work for me

So for the php.ini file, I copied php.ini-production and then only added the changes the Nextcloud team mentioned. I can’t show you database files because I’m using MariaDB (which, I recommend you also scrap SQLite for MariaDB 10.2. I did not edit my php-fpm.conf file, but I did edit the /usr/local/etc/php-fpm.d/www.conf file:

; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]

; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr/local) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
user = www
group = www

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;                            a specific port;
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses
;                            (IPv6 and IPv4-mapped) on a specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.

; Note: This value is mandatory.

;listen = 127.0.0.1:9000
listen = /var/run/php-fpm.sock

; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
listen.backlog = -1

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
;                 mode is set to 0660
listen.owner = www
listen.group = www
listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =

; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
;listen.allowed_clients = 127.0.0.1

; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
;       - The pool processes will inherit the master process priority
;         unless it specified otherwise
; Default Value: no set
; process.priority = -19

; Choose how the process manager will control the number of child processes.
; Possible Values:
;   static  - a fixed number (pm.max_children) of child processes;
;   dynamic - the number of child processes are set dynamically based on the
;             following directives. With this process management, there will be
;             always at least 1 children.
;             pm.max_children      - the maximum number of children that can
;                                    be alive at the same time.
;             pm.start_servers     - the number of children created on startup.
;             pm.min_spare_servers - the minimum number of children in 'idle'
;                                    state (waiting to process). If the number
;                                    of 'idle' processes is less than this
;                                    number then some children will be created.
;             pm.max_spare_servers - the maximum number of children in 'idle'
;                                    state (waiting to process). If the number
;                                    of 'idle' processes is greater than this
;                                    number then some children will be killed.
;  ondemand - no children are created at startup. Children will be forked when
;             new requests will connect. The following parameter are used:
;             pm.max_children           - the maximum number of children that
;                                         can be alive at the same time.
;             pm.process_idle_timeout   - The number of seconds after which
;                                         an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic

; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 20

; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2

; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 2

; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3

; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500

; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
;   pool                 - the name of the pool;
;   process manager      - static, dynamic or ondemand;
;   start time           - the date and time FPM has started;
;   start since          - number of seconds since FPM has started;
;   accepted conn        - the number of request accepted by the pool;
;   listen queue         - the number of request in the queue of pending
;                          connections (see backlog in listen(2));
;   max listen queue     - the maximum number of requests in the queue
;                          of pending connections since FPM has started;
;   listen queue len     - the size of the socket queue of pending connections;
;   idle processes       - the number of idle processes;
;   active processes     - the number of active processes;
;   total processes      - the number of idle + active processes;
;   max active processes - the maximum number of active processes since FPM
;                          has started;
;   max children reached - number of times, the process limit has been reached,
;                          when pm tries to start more children (works only for
;                          pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
;   pool:                 www
;   process manager:      static
;   start time:           01/Jul/2011:17:53:49 +0200
;   start since:          62636
;   accepted conn:        190460
;   listen queue:         0
;   max listen queue:     1
;   listen queue len:     42
;   idle processes:       4
;   active processes:     11
;   total processes:      15
;   max active processes: 12
;   max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
;   http://www.foo.bar/status
;   http://www.foo.bar/status?json
;   http://www.foo.bar/status?html
;   http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
;   http://www.foo.bar/status?full
;   http://www.foo.bar/status?json&full
;   http://www.foo.bar/status?html&full
;   http://www.foo.bar/status?xml&full
; The Full status returns for each process:
;   pid                  - the PID of the process;
;   state                - the state of the process (Idle, Running, ...);
;   start time           - the date and time the process has started;
;   start since          - the number of seconds since the process has started;
;   requests             - the number of requests the process has served;
;   request duration     - the duration in µs of the requests;
;   request method       - the request method (GET, POST, ...);
;   request URI          - the request URI with the query string;
;   content length       - the content length of the request (only with POST);
;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
;   script               - the main script called (or '-' if not set);
;   last request cpu     - the %cpu the last request consumed
;                          it's always 0 if the process is not in Idle state
;                          because CPU calculation is done when the request
;                          processing has terminated;
;   last request memory  - the max amount of memory the last request consumed
;                          it's always 0 if the process is not in Idle state
;                          because memory calculation is done when the request
;                          processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
;   ************************
;   pid:                  31330
;   state:                Running
;   start time:           01/Jul/2011:17:53:49 +0200
;   start since:          63087
;   requests:             12808
;   request duration:     1250261
;   request method:       GET
;   request URI:          /test_mem.php?N=10000
;   content length:       0
;   user:                 -
;   script:               /home/fat/web/docs/php/test_mem.php
;   last request cpu:     0.00
;   last request memory:  0
;
; Note: There is a real-time FPM status monitoring sample web page available
;       It's available in: /usr/local/share/php/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status

; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping

; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong

; The access log file
; Default: not set
;access.log = log/$pool.access.log

; The access log format.
; The following syntax is allowed
;  %%: the '%' character
;  %C: %CPU used by the request
;      it can accept the following format:
;      - %{user}C for user CPU only
;      - %{system}C for system CPU only
;      - %{total}C  for user + system CPU (default)
;  %d: time taken to serve the request
;      it can accept the following format:
;      - %{seconds}d (default)
;      - %{miliseconds}d
;      - %{mili}d
;      - %{microseconds}d
;      - %{micro}d
;  %e: an environment variable (same as $_ENV or $_SERVER)
;      it must be associated with embraces to specify the name of the env
;      variable. Some exemples:
;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
;  %f: script filename
;  %l: content-length of the request (for POST request only)
;  %m: request method
;  %M: peak of memory allocated by PHP
;      it can accept the following format:
;      - %{bytes}M (default)
;      - %{kilobytes}M
;      - %{kilo}M
;      - %{megabytes}M
;      - %{mega}M
;  %n: pool name
;  %o: output header
;      it must be associated with embraces to specify the name of the header:
;      - %{Content-Type}o
;      - %{X-Powered-By}o
;      - %{Transfert-Encoding}o
;      - ....
;  %p: PID of the child that serviced the request
;  %P: PID of the parent of the child that serviced the request
;  %q: the query string
;  %Q: the '?' character if query string exists
;  %r: the request URI (without the query string, see %q and %Q)
;  %R: remote IP address
;  %s: status (response code)
;  %t: server time the request was received
;      it can accept a strftime(3) format:
;      %d/%b/%Y:%H:%M:%S %z (default)
;      The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
;  %T: time the log has been written (the request has finished)
;      it can accept a strftime(3) format:
;      %d/%b/%Y:%H:%M:%S %z (default)
;      The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
;  %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"

; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
;slowlog = log/$pool.log.slow

; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0

; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024

; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0

; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
;       possible. However, all PHP paths will be relative to the chroot
;       (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =

; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www

; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes

; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
;clear_env = no

; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; execute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
security.limit_extensions = .php .php3 .php4 .php5 .php7 .html .htm

Make note: I am using /var/run/php-fpm.sock for listening, not 127.0.0.1:9000

Now for my nginx.conf file:

user www;
worker_processes        1;

error_log       /var/log/nginx/error.log;

events {
        worker_connections 1024;
}

http {

        include mime.types;
        default_type application/octet-stream;
        sendfile on;
        keepalive_timeout 70;
        add_header Strict-Transport_security "max-age=15552000; includeSubDomains; preload";

        upstream php-handler {
                #server 127.0.0.1:9000;
                server unix:/var/run/php-fpm.sock;
        }

        server_tokens   off;
        access_log      /var/log/nginx/access.log;

    server {
        listen 80;
        server_name mydomain.com;
        # enforce https
        return 301 https://$server_name$request_uri;
    }

    server {
        listen 443 ssl http2;
        server_name mydomain.com;


        ssl on;
        ssl_certificate /usr/local/etc/letsencrypt/live/mydomain.com/fullchain.pem;
        ssl_certificate_key /usr/local/etc/letsencrypt/live/mydomain.com/privkey.pem;

            ssl_session_timeout 1d;
            ssl_session_cache shared:SSL:50m;
            ssl_session_tickets off;

            ssl_protocols TLSv1.1 TLSv1.2;
            ssl_prefer_server_ciphers on;
            #ssl_dhparam /usr/local/etc/ssl/dhparam.pem;
            ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';



            # OCSP Stapling ---
            # fetch OCSP records from URL in ssl_certificate and cache them
            ssl_stapling on;
            ssl_stapling_verify on;



        # Add headers to serve security related headers
        # Before enabling Strict-Transport-Security headers please read into this
        # topic first.
        # add_header Strict-Transport-Security "max-age=15768000;
        # includeSubDomains; preload;";
        #
        # WARNING: Only add the preload option once you read about
        # the consequences in https://hstspreload.org/. This option
        # will add the domain to a hardcoded list that is shipped
        # in all major browsers and getting removed from this list
        # could take several months.
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload";

        # Path to the root of your installation
        root /usr/local/www/nginx/nextcloud;

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        # The following 2 rules are only needed for the user_webfinger app.
        # Uncomment it if you're planning to use this app.
        #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
        #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
        # last;

        location = /.well-known/carddav {
        return 301 $scheme://$host/remote.php/dav;
        }
        location = /.well-known/caldav {
        return 301 $scheme://$host/remote.php/dav;
        }

        # set max upload size
        client_max_body_size 2048M;
        #fastcgi_buffers 64 4K;
        fastcgi_buffers 128 1M;
        fastcgi_buffer_size 128K;
        sendfile    on;

        # Enable gzip but do not remove ETag headers
        gzip on;
        gzip_vary on;
        gzip_comp_level 2;
        gzip_min_length 256;
        gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
        gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

        # Uncomment if your server is build with the ngx_pagespeed module
        # This module is currently not supported.
        #pagespeed off;

        location / {
            rewrite ^ /index.php$uri;
        }

        location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
            deny all;
        }
        location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
            deny all;
        }

        location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param HTTPS on;
            #Avoid sending the security headers twice
            fastcgi_param modHeadersAvailable true;
            fastcgi_param front_controller_active true;
            fastcgi_pass php-handler;
            fastcgi_intercept_errors on;
            fastcgi_request_buffering off;
        }

        location ~ ^/(?:updater|ocs-provider)(?:$|/) {
            try_files $uri/ =404;
            index index.php;
        }

        # Adding the cache control header for js and css files
        # Make sure it is BELOW the PHP block
        location ~ \.(?:css|js|woff|svg|gif)$ {
            try_files $uri /index.php$uri$is_args$args;
            add_header Cache-Control "public, max-age=15778463";
            # Add headers to serve security related headers (It is intended to
            # have those duplicated to the ones above)
            # Before enabling Strict-Transport-Security headers please read into
            # this topic first.
            # add_header Strict-Transport-Security "max-age=15768000;
            #  includeSubDomains; preload;";
            #
            # WARNING: Only add the preload option once you read about
            # the consequences in https://hstspreload.org/. This option
            # will add the domain to a hardcoded list that is shipped
            # in all major browsers and getting removed from this list
            # could take several months.
            add_header X-Content-Type-Options nosniff;
            add_header X-XSS-Protection "1; mode=block";
            add_header X-Robots-Tag none;
            add_header X-Download-Options noopen;
            add_header X-Permitted-Cross-Domain-Policies none;
            add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload";
            # Optional: Don't log access to assets
            access_log off;
        }

        location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
            try_files $uri /index.php$uri$is_args$args;
            # Optional: Don't log access to other assets
            access_log off;
        }
    }

}

A couple things to note here: Again, I also have php-fpm.sock enabled instead of 127.0.0.1:9000 for the php-handler for nginx. I also assume you’re using HTTPS, and I have a forced redirect to port 443 going on here

thanks for the posts, but they do not respond to my problem. I am not attempting to change the version of php nor the database type. Just get things running on a new server.

I’ll fetch it from the old server thanks!

I’m going to abandon this install and start fresh. Other sites on the new server run fine with php5.6x and I’m going to stick to what FreeBSD defines as default before opening that can of worms…

hence I was able to install /usr/ports/devel/pecl-APCu4/
which is compatible with php 5.6x

On migrating NC to anywhere from anything
There are simply too many gotchas with nextcloud
technologies like docker is not helping fix that fact, developers are able to step over architectural flaws, this may explain why Nextcloud remains a controversial solution in many circles…

I understand your concern. My guess then perhaps is you’re missing the proper dependencies for DB management. And this might be a silly question, but php-fpm service is running right? To me, this spells you are missing a change that is DB related to PHP

I moved my Nextcloud install from Ubuntu server to FreeBSD with nginx a couple months ago without a hitch (though, Nginx came later down the pipe). The move would simply be copy your webroot, datadir if it’s separate and export/import your db tables and perhaps recreate your db users and the migration is complete. Just like any other website requiring LAMP/FAMP

php-fpm/nginx/mysql is working great elsewhere on this machine. Nextcloud had preselected something else, and tada it died on migration. The brand new Install uses mysql.

I also migrated a complete Postfix/dovecot/spamd/spamassasin/postfixadmin/maiad/spf/dkim mail server solution, 5 wordpress, a bunch of other php based sites and nextcloud was the only loss of data after following without deviation their migration guide… even disabling all apps…

I’ve run into and reported ridiculous bugs in Nextcloud, alas there is nothing else really quite like having your own dropbox…

Perhaps in your large array of migrations you missed something here? If you are having Nextcloud magically making changes on you like db types, you’re definitely making some sort of mistake in migrating your database. My hunch still lies in you have some incorrect configurations pertaining to your database. But, I see your mind is made up and instead of seeking help you just want to rant and make comments about competition products.

Fortunately not!
I did not follow your advice to install additional software, your advice particularly proved to not be of any assistance to whatever the issue was. A fresh install works fine (see image below) I would suggest in the future you do not propose to help people by taking steps which may compound the complexity, and ignore the actual cause of the malfunction.

Your initial problem was a missing table. Did you check if your database was ok? Please use a proper database, sqlite is only for single user setups and should only be used if no real database can be used at all.

If you are already making the effort moving everything to a new server, I’d consider PHP 7 which has much better performance.

That may be possible, I early on attempted to convert the Sqlite to mysql and that did not work out. Upon Migration failing it became an opportunity to link it up with Mysql from the start.

I’d love to use PHP7 and moving to it is a trivial matter, but I am using other software on the box that may not work with it.
For example I am not sure Maia Mailguard http://www.maiamailguard.com, and PostfixAdmin work with it. I have put an inquiry out there, but PHP7 is a different project than replacing Apache with Nginx as that depends solely on my ability as an admin to make a coherent config for nginx not compatibility with projects which simply work and have not been modified for a decade.