Thursday, January 20, 2011

What should I change in php.ini to enable usage of sqlite from PHP?

At the moment I cannot use sqlite from PHP. Probably I need to change something in my php.ini file. In my php.ini file I found 2 lines containing "sqlite":

[sqlite]
;sqlite.assoc_case = 0

Does semicolon in front of the line means that line is commented? Should I uncomment the second line? Should I change the value of the "sqlite.assoc_case" from 0 to something else?

P.S. I have 2 php.ini files:
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
which one should I change?

  • Have you tried my suggestion in your other question to install the php5-sqlite package?

    What you're looking for in php.ini once this package is installed is a line similar to extension=sqlite.so (the module name may be slightly different.)

    The options in the [sqlite] section just change the options when SQLite is in use correctly.

    Yes a ; in front of a line is a comment.

    The file you want to change is the one Apache is using (if you're using accessing your PHP script through a web browser.)

    Roman : I just tried to install php5-sqlite and got the following: Building dependency tree Reading state information... Done Package php5-sqlite3 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package php5-sqlite3 has no installation candidate
    Roman : I have installed php5-sqlite (not php5-sqlite3) and it worked. Thank you very much!

0 comments:

Post a Comment