安装 Ubuntu 包,缺少 php7.0-sqlite3

安装 Ubuntu 包,缺少 php7.0-sqlite3

使用 php7 的 Ubuntu

尝试从 php 使用 SQLite3 时发生错误:

PHP Fatal error:  Class 'SQLite3' not found in /var/www/html/index.php on line 1

我尝试安装 php7.0-sqlite3:

$ sudo apt-get install php7.0-sqlite3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-sqlite3
E: Couldn't find any package by regex 'php7.0-sqlite3'

显然包裹丢失了:

$ sudo apt-cache search php7.0-*
php7.0-mysql - MySQL module for PHP
php7.0-readline - readline module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0 - server-side, HTML-embedded scripting language (metapackage)
libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-json - JSON module for PHP
php7.0-common - documentation, examples and common module for PHP    

如何添加包裹?

答案1

尝试sudo apt-get install php-sqlite3

在迁移过程中,软件包保持这种状态,以防止 sqlite3 超过 7.1 版本时出现任何问题

相关内容