February 26, 2023 Network

Installing SQLite PDO extension for php-fpm in Debian/Ubuntu

February 26, 2023
Qice, Editor

Problem

Sometimes we need SQLite rather than MySql/MariaDB.
For php-fpm, SQLite PDO extension, namely "php-sqlite", is essential extension to support.

However, when running a command:
sudo apt-get install php-sqlite

the terminal prompts error:
E: Package 'php-sqlite' has no installation candidate

Solution

First, runing a command to search software package of "sqlite":
apt-cache search php | grep sqlite

In my terminal:

php-sqlite3 - SQLite3 module for PHP [default]  
php7.4-sqlite3 - SQLite3 module for PHP

Then, just runing a command "php-sqlite3" to install, not "php-sqlite":
sudo apt-get install php-sqlite3

Finally, restart Nginx:
sudo systemctl restart nginx

Done.

© 2023 Lab x LingData. All Rights Reserved
Theme by BlThemes - Powered by Bludit