Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-04 Thread Markus Wolff - NorthClick
Am Mittwoch, den 03.10.2007, 20:25 +0300 schrieb Thodoris: > I came up with this try to edit your php.ini and in case you use > pdo_sqlite extension then change the order of the loaded modules to > this: > > extension=pdo.so > extension=pdo_sqlite.so > extension=sqlite.so Still

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-04 Thread Markus Wolff - NorthClick
Am Donnerstag, den 04.10.2007, 10:53 +1000 schrieb Chris: > > mmh wonder what could possibly be wrong when even trying 777? :-) > > Some hosts check for and disable access to files that have wide-open > permissions - usually when php is running as a cgi but I've seen it when > using mod_php too.

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Chris
Markus Wolff wrote: Chris schrieb: It can't be file permissions, I've even tried to set the database file to 777... no change at all. My guess is still permissions. If you try a raw fopen instead of using pdo, what happens? \n"; } else { echo "Unable to open db\n"; } fclose($fp); ?> Hey

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Thodoris
Hi again Markus, This is realy confusing but since the command line execution works for you then the problem should be php configuration for the mod_php. I came up with this try to edit your php.ini and in case you use pdo_sqlite extension then change the order of the loaded modules to this:

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Markus Wolff
Hi Thodoris, I've checked on one of the three boxes now and the SQLite version used by both the commandline client and PDO is 3.2.8. I know the other two boxes have different versions, but I always created the database anew on each box. I also tried chown/chmod on the parent directory, no ch

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Thodoris
Hey Markus, You should try to "chown apache:apache" and "chmod +w" to the directory that includes frontend.db . And the link that I posted says: |/* ** file_format==1Version 3.0.0. ** file_format==2Version 3.1.3. ** file_format==3Version 3.1.4. ** ** Version 3.0 can only use files w

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Markus Wolff
Hey there, I've double-checked on three different machines now, and I'm always getting the same error. All having different versions of PHP, Apache, PDO and SQLite. So I figure it must be something that I'm doing wrong. I just can't figure out what it is - and I'm puzzled because I had used S

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Thodoris
I run into this: http://www.php.net/manual/en/ref.pdo-sqlite.php while searching for a solution to this exception: PDOException: SQLSTATE[HY000]: General error: 1 Take a look at it bacause this might be happenning due to version incompatibilities. For example only sqlite version 3.1.4 and after

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Markus Wolff
Chris schrieb: It can't be file permissions, I've even tried to set the database file to 777... no change at all. My guess is still permissions. If you try a raw fopen instead of using pdo, what happens? \n"; } else { echo "Unable to open db\n"; } fclose($fp); ?> Hey Chris, mmh wonder w

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-03 Thread Thodoris
Well the directory that houses the database should be writable. Running the script from command line it gives you write access probably but it won't work using mod_php because the web server probably can't write. Try it and give us some feedback. -- Thodoris O/H Chris έγραψε: Markus Wo

Re: [PHP-DB] Can't open SQLite DB... but only when using mod_php??

2007-10-02 Thread Chris
Markus Wolff - NorthClick wrote: Hey there, I'm trying to open an SQLite3 database from a PHP very simple PHP script: $db = dirname(__FILE__).'/frontend.db'; $pdo = new PDO('sqlite:'.$db); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->query("SELECT * FROM page LIMIT 1");