seblucas / cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
1.44k stars 229 forks source link

sqlite3 does not work on DMS #466

Open HomeLH opened 5 years ago

HomeLH commented 5 years ago

You've been redirected because COPS is not configured properly Database error Check if PHP version is correct OK (5.6.40) Check if GD is properly installed and loaded OK Check if Sqlite is properly installed and loaded Please install the php5-sqlite extension and make sure it's enabled Check if libxml is properly installed and loaded OK Check if Json is properly installed and loaded OK Check if mbstring is properly installed and loaded OK Check if intl is properly installed and loaded OK Check if Normalizer class is properly installed and loaded OK Check if the rendering will be done on client side or server side Client side rendering Check if Calibre database path is not an URL OK Check if Calibre database file exists and is readable OK Check if Calibre database file can be opened with PHP If the file is readable, check your php configuration. Exception detail : exception 'PDOException' with message 'could not find driver' in /volume1/web/cops/checkconfig.php:203 Stack trace: #0 /volume1/web/cops/checkconfig.php(203): PDO->construct('sqlite:/volume1...') #1 {main} Check if Calibre database file contains at least some of the needed tables If the file is readable, check your php configuration. Exception detail : exception 'PDOException' with message 'could not find driver' in /volume1/web/cops/checkconfig.php:216 Stack trace: #0 /volume1/web/cops/checkconfig.php(216): PDO->construct('sqlite:/volume1...') #1 {main}

horus68 commented 5 years ago

I think (not a guarantee) this is not an issue with COPS but with your system. This question is all over the internet:

The driver needs to be enabled under Extensions in php.ini + restart your web server. "Driver" is the database driver for MySQL, SQLite or other database you may be using. The driver needs to be enabled (not commented) under Extensions in php.ini + restart your web server.

Sample extensions in php.ini:

;extension=pdo_XPTO  <- this driver is disabled, so XPTO will not work
extension=pdo_mysql

Try this one: use php-sqlite3 package instead of php5-sqlite https://stackoverflow.com/questions/2852748/pdoexception-could-not-find-driver https://ixnfo.com/en/the-solution-of-the-error-pdoexception-could-not-find-driver.html

nicholbb commented 4 years ago

Hi, I had the same issue using COPS 1.0.1 (synocommunity) solution for mine was: Web Station --> PHP Settings Edit the Default Profile and tick pdo_sqlite under Extensions (along with gd). I had to refresh the page a few times (think I even closed my browser).

I only worked this out by looking at the checkconfig.php file.

To replicate my setup (if above quick fix didn't do it): Open Web Station (from menu or via package center). Check the below on the tabs: Status Default Server status = Normal

Back-end Packages Nginx = Installed Apache HTTP Server 2.2 = Installed PHP 5.6 = Installed

General Settings HTTP back-end server: Nginx PHP: Default Profile (PHP 5.6)

PHP Settings Enable PHP cache = ticked Customize PHP open_basedir = (appended path to Calibre database) :/volume1/xxx/library/ Extensions gd = ticked pdo_sql = ticked

Hope that helps

glls commented 4 years ago

I can confirm that it works on DSM 6 with php 7.3 and nginx, almost got the same config with @nicholbb's and sqlite driver is pdo_sqlite.