Problem setting up my DB - Checking supported SQLite PHP extensions

Issue #286 resolved
Ondrej Sojka created an issue

PDO: installed PDO SQLite Driver: not installed SQLite3: installed SQLiteDatabase: not installed

Why the app doesn't use SQLite3 extension from PHP? I looked in php.ini and it looks like there is no other sqlite extension except sqlite3. (newest PHP 5)

I checked the PHP logs and only thing that appeared is PHP warning that it's not safe to rely on system's timezone. "We selected UTC for now", the log says. I don't really care about the time.

Comments (15)

  1. Christopher Kramer

    Is there a SQLite database in the phpliteAdmin directory? If there is a version 2 database file in the directory and you only have sqlite3 installed, then you will get this error.

  2. Ondrej Sojka reporter

    There is a SQLite3 database one directory below, but I have this in my phpliteadmin.config.php:

     $directory = 'projectdir';
     $subdirectories = true;
    

    Which, I think, should mean that phpliteadmin will search the directory ./projectdir for files ending with .db? The file is located at /srv/http/projectdir/stats.db, phpLiteAdmin is located at /srv/http/phpliteadmin.php

    Looks like phpLiteAdmin found the file with the db - it says: There was a problem setting up your database, projectdir/stats.db

    Thanks for patience

  3. Ondrej Sojka reporter

    Almost sure - I created it with the sqlite3 command. And the command also opens it without any problems.

  4. Christopher Kramer

    Ok, please try this: Search for:

    define("FORCETYPE", false);
    

    And replace it with this:

    define("FORCETYPE", "SQLite3");
    
  5. Ondrej Sojka reporter

    Pretty weird. Created a new empty database test.db with sqlite3 program in the same directory, moved the other and phpLiteAdmin didn't even found "any valid SQLite databases"... test.db is empty, with no tables, and stats.db is with one table that has 119 columns. Column names are random 5 chars long strings. A few rows (<500) there, all of smallint type. (I can send the file if you want.)

    The sqlite3 program can open it and show all rows btw.

  6. Christopher Kramer

    Okay, you can mail the DB to info AT phpliteadmin DOT org . Have you tried moving all DBs out of the directory and creating one with phpLiteAdmin?

  7. Ondrej Sojka reporter

    Sent. I didn't , because it would be pretty hard to click 119 columns in phpLiteAdmin.

  8. Christopher Kramer

    Thanks. phpLiteAdmin is able to read your DB on my pc with both SQLite3 and PDO... But the FORCETYPE configuration did not really work, which I just fixed. Can you please download the current development version here: http://phpliteadmin.org/phpliteadmin-dev.zip Then change FORCETYPE again to SQLite3 and try again if that works.

  9. Ondrej Sojka reporter

    Still doesn't... The webserver is lighttpd, kernel version 4.1.12-1-ARCH, PHP connected through FastCGI to webserver. PHP's version 5.6.15.

    SQLite library version 3.9.1, SQLite3 module version 0.7-dev.

  10. Jul

    Hi,

    I just had the same problem. Newly created sqlite3 database using the sqlite3 command line tool and phpliteadmin breaks with:

    PDO: installed PDO SQLite Driver: installed SQLite3: installed SQLiteDatabase: not installed

    The file command says: "SQLite 3.x database, last written using SQLite version 3022000".
    I added a table so the file isn't empty but that doesn't help. Also setting "define("FORCETYPE", "SQLite3");" in the source has no effect. Replacing the file with an empty one or deleting it (so phpmyadmin would create a new one) produces the same error message.

    Another database file works. But using a copy of that file doesn't.

    That led me to check the file permissions (while I was writing this comment;)): working_directory had 777 with me as owner, working_database 644 with www-data as owner.

    The not working database had the same owner and permission. But the directory only 766 as permission. This for some reason breaks phplitadmin without a warning about file/directory permissions (like it is done if the directory is not writeable). Instead the misleading output about installed php extensions is shown. Changing the directory to 777 solved the issue.

    Both databases were set up in the phpliteadmin.config.php's databases array. $directory and $subdirectories were false.

    I'm using Debian with lighttpd 1.4.45-1+b1, phpinfo() says: PHP Version 7.2.2-1 SQLite3 module version 7.2.2-1 SQLite Library 3.22.0

    And phpliteadmin 1.9.7.1 (Last updated: 2016-12-14)

  11. phpLiteAdmin repo owner

    @styxxxde Thanks a lot. I can confirm that missing execute-permissions cause misleading error messages. With commit 62a8e73 , execute permissions are now checked and an appropriate error message displayed in case they are missing.

  12. Log in to comment