我有一个完美运行的安装,但由于 EOL,需要将 PHP 7.3 升级到 7.4。
从那时起,我遇到了一个错误:
Fatal error: Uncaught Error: Class 'PDO' not found in /usr/local/www/nextcloud/lib/private/DB/Connection.php:103
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/AppConfig.php(341): OC\DB\Connection->getQueryBuilder()
#1 /usr/local/www/nextcloud/lib/private/AppConfig.php(109): OC\AppConfig->loadConfigValues()
#2 /usr/local/www/nextcloud/lib/private/AppConfig.php(300): OC\AppConfig->getApps()
#3 /usr/local/www/nextcloud/lib/private/legacy/OC_App.php(972): OC\AppConfig->getValues(false, 'installed_versi...')
#4 /usr/local/www/nextcloud/lib/private/Server.php(691): OC_App::getAppVersions()
#5 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}(Object(OC\Server))
#6 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#7 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet('OC\\Memcac in /usr/local/www/nextcloud/lib/private/DB/Connection.php on line 103
但是,模块 PDO是存在且已加载:
php -m | grep -i pdo
PDO
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
尝试重新安装整个 PHP,但没有成功。
请注意,所有occ
命令都成功。
我的配置:
- FreeBSD 13
- Nextcoud 23.0
- PHP 7.4
答案1
最后将整个 PHP 升级到 8.0,问题就解决了