在Ubuntu 21.10上安装php 8.1的sqlite驱动程序应与运行一样简单:
sudo apt install php-sqlite3
但是,如果您有错误:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php8.1-sqlite3 : Depends: php8.1-common (= 8.1.2-1ubuntu2.10) but 8.1.5-1+ubuntu21.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
那么您的公司就好了。这就是我解决的方式。它。
解决方案
nb:您应该已经安装了PHP 8.1。运行php --version
应该给出php 8.1
及以上的结果。
1.更新系统依赖性
sudo apt update
sudo apt upgrade
2.添加PHP PPA
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
3.安装php-sqlite3
sudo apt install php8.1-sqlite3
这应该现在起作用。
致谢
本文只是https://medium.com/@laraveltuts/how-to-install-and-run-php-8-x-on-ubuntu-20-04-8f18e7565c41无耻的副本,专门用于解决未满足的依赖性问题。