zjunior has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks.
I really like the SQLite database, but using Activestate Perl (last version) and DBD::SQLite, even the simplest line from the docs make perl.exe crash:
use DBI; my $dbh = DBI->connect('dbi:SQLite:teste.db','','');
It crashes Apache with mod_perl too.
The database teste.db exists and was created previously with the "sqlite" tool.

Anyone had this problem and knows a possible solution?
Thanks.

Replies are listed 'Best First'.
Re: DBD::SQLite crashes under win2k
by vek (Prior) on Nov 13, 2002 at 13:55 UTC
    Did you check Apache's error_log for any clues? Can you run DBD::SQLite standalone in Perl - i.e without Apache?

    -- vek --
Re: DBD::SQLite crashes under win2k
by iburrell (Chaplain) on Nov 13, 2002 at 17:16 UTC
    I had the same problem with DBD::SQLite crashing on Windows 2000 with ActivePerl 5.6.1. I was using the PPM DBD::SQLite from Kobes repository. If you are using the same version, it could be a problem with that build. You might try building the module from source or finding another packaged version.
Re: DBD::SQLite crashes under win2k
by zjunior (Beadle) on Nov 17, 2002 at 03:32 UTC
    I found the problem.
    Even in Linux DBD::SQLite was crashing perl.
    There's a note in the SQLite's webpage that the format of the database was changed in recent versions.
    I was creating the database using the sqlite tool, and it was the last version, generating a database incompatible with the library that comes with DBD::SQLite, making perl segfault.
    Updating the module from CPAN works, and for WIndows, updating from the theory5 (http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer) ppm repository seems to work with a recent sqlite tool.

    Update: If you cannot update the module, creating and managing your database with dbish may work. Do NOT open the database with a recent sqlite tool, because it will be upgraded automagicaly.
    The syntax is: dbish DBI:SQLite:database.db