0

Hi all,
I have ubuntu and just installed sqlite then edit the php.ini file accordingly but for some reason the class named ¨SQLiteDatabase()¨ reports as undefined. The error is as follows:

Fatal error: Uncaught exception 'SQLiteException' with message 'SQLiteDatabase::__construct() [<a href='sqlitedatabase.--construct'>sqlitedatabase.--construct</a>]: unable to open database: /var/www/vhosts/cwarn23/base' in /var/www/vhosts/cwarn23/php.php:3 Stack trace: #0 /var/www/vhosts/cwarn23/php.php(3): SQLiteDatabase->__construct('base', 438, 'unable to open ...') #1 {main} thrown in /var/www/vhosts/cwarn23/php.php on line 3

And my script is

<?php
$dbname='base';
$base=new SQLiteDatabase($dbname, 0666, $err);
if ($err)
{ 
  echo "SQLite NOT supported.\n";
  exit($err);
}
else
{
  echo "SQLite supported.\n";
}

So does anyone know what would make sqlite behave in such a way? Also the tutorial I was following is at http://www.scriptol.com/sql/sqlite-getting-started.php
And yes I tried restarting apache after making changes to php.ini

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by cwarn23
1

Do you have write permissions to the directory ?

Votes + Comments
Great life saving post in speedy time();
0

Thank you times 1 million. Couldn't work out why every tutorial didn't work and of course the permissions. Glad to see somebody can always help even the most experienced.
Thanks ^_^

0

Thank you times 1 million. Couldn't work out why every tutorial didn't work and of course the permissions. Glad to see somebody can always help even the most experienced.
Thanks ^_^

Hehe. If the problem is solved then mark the thread as solved, so nobody else wastes his effort to debug your problem ;)

0

I forgot about the how solved threads add to the stats. And yea I was going to leave it open for if I had more questions. I guess I'll just open another topic if I have more questions. Anyways *solved*

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.