在使用 nginx 的 Ubuntu 服务器上安装适用于 php8.3 的 sqlite3

问题描述 投票:0回答:1

我想为运行 php 8.3 的网站启用 sqlite。这个网站应该使用 sqlite,但是当我尝试安装它时(就像在 php 8.2 中)

sudo apt install php8.3-sqlite3
它不起作用。如何在 php 8.3 中安装 sqlite?

我认为sqlite在php 8.2之间没有太大的变化,是否可以从php 8.2复制?


我尝试

sudo apt install php8.3-sqlite3
。但它又回来了

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.3-sqlite3
E: Couldn't find any package by glob 'php8.3-sqlite3'

我浏览了一些不起眼的论坛。他们说编译我自己的 sqLite 来使用它,但如果没有真正的教程,它对我来说太晦涩了

php sqlite ubuntu
1个回答
0
投票

对于 Ubunut 服务器 - 假设您已安装 Ubuntu Server 22.04 LTS(长期支持)

确保您已添加存储库(例如 php 的 ppa:ondrej/php 存储库),使用

sudo add-apt-repository ppa:ondrej/php

并确保您已更新/升级 apt,并使用

安装了必要的 ca 证书
sudo apt update && apt upgrade

sudo apt-get install ca-certificates apt-transport-https software-properties-common

之后,您应该可以通过以下方式安装 php8.3-sqlite3

sudo apt install php8.3-sqlite3

因此,以下是安装所需的命令

sudo -s

sudo add-apt-repository ppa:ondrej/php

sudo apt update && apt upgrade

sudo apt-get install ca-certificates apt-transport-https software-properties-common

sudo apt install nginx 

sudo apt-get purge 'php*'

sudo apt install php8.3 php8.3-fpm php8.3-mysql php8.3-imap php8.3-ldap php8.3-xml php8.3-curl php8.3-mbstring php8.3-zip

sudo systemctl enable php8.3-fpm --now

sudo systemctl restart nginx

sudo apt install php8.3-sqlite3

sudo systemctl restart nginx

© www.soinside.com 2019 - 2024. All rights reserved.