使用php连接到sqlite数据库的问题

问题描述:

我需要使用 php 连接到 sqlite 数据库.我已经在我的本地系统上安装了 sqlite 并在 linux 机器(我们的本地服务器)上配置了一个 web 服务器.当我在 linux 机器上执行 php 文件时,它不起作用,它只是显示一个空白页面.

I need to connect to a sqlite database using php. I have installed sqlite on my local system and configured a web server on a linux machine (our local server.) When I execute the php file on the linux machine, it does not work, it just shows a blank page.

我需要在同一台机器上安装 sqlite 和 php 吗?

Do I need to install both sqlite and php on the same machine?

SQLite 并不是真正的 DBMS,而更像是一个带有一些 API 的平面文件,以 SQL 数据库的方式对其进行操作.
没有要连接的服务器或恶魔,而只是要打开的文件.所以,没有什么可以安装的.

SQLite is not really a DBMS, but more like a flat file with some API to operate it in the manner of SQL database.
there is no server or demon to connect to, but merely a file to open. So, there is nothing to install.

只安装 PHP,然后在 php.ini 中取消 SQLite 模块的注释.
然后只需在您的代码中打开 sqlite 文件.
仅此而已.

Install PHP only and then uncomment SQLite module in php.ini.
Then just open sqlite file in your code.
That's all.