PDA

Bekijk de volledige versie : SQLite cannot find database problem



VidJa
28-02-2006, 12:44
I cannot get php and sqlite to work on my WL500g (Oleg's firmware 7b)

website works, php works, dropbear and samba work
SQLite commandline works, but I cannot connect to a database from php.

I followed the tutorial on http://www.zend.com/php/beginners/php101-9.php
I can create the library.db database, fill it with data and query it on the commandline, but when I try to run the php scripts that should connect, it dies with the 'could not open database message'

This is what phpinfo reports on SQLite:

SQLite support enabled
PECL Module version 2.0-dev $Id: sqlite.c,v 1.146.2.3 2004/09/26 01:41:40 wez Exp $
SQLite Library 2.8.14
SQLite Encoding iso8859

this is the code that give the problem:


<?php
// set path of database file
$db = "library.db";

// open database file
$handle = sqlite_open($db) or die("Could not open database");
?>

I checked all permissions on the file 'library.db', they have even been set at 777. I can get the file size with echo filesize($db) so it can be accessed.
I copied the files to my development Debian box and it works flawlessly in that environment.


Is there somebody who did get sqlite and php to work on a WL500g? Am I missing something?

greengreen
10-09-2006, 08:12
Hi i have same problem anybody knows?