Discussion:
[PHP-INSTALL] PHP + SQLite = tearing hairs..
RRybak
2009-11-17 06:59:27 UTC
Permalink
Hello,

I've spend some days on googling, but as for now - without any effect.

----------
The configuration follows:
- Windows 7 64bit (build 7100)
- PHPInfo -> Apache/2.2.13 (Win32) PHP/5.3.0
PDO drivers mysql, odbc, sqlite

PDO Driver for SQLite 3.x enabled
SQLite Library 3.6.15

SQLite3 support enabled
SQLite3 module version 0.7-dev
SQLite Library 3.6.15

Directive Local
Value Master Value
sqlite3.extension_dir E:\Program Files (x86)\PHP\ext E:\Program Files
(x86)\PHP\ext
---------------
php.ini has the following two lines:
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_SQLITE3]
extension=php_sqlite3.dll

both DLL's are in ext folder.
------
Everything works fine, till I wanted to embed database support. On
sqlite_open() I get the infamous:
"Fatal error: Call to undefined function sqlite_open()"

(trying 1 argument and/or 3 arguments function call)

I start to wonder if it is compatible with 64bit system, but everything
looks loaded and properly configured.
Help..?
Étienne Buira
2009-11-17 20:21:44 UTC
Permalink
Post by RRybak
Hello,
I've spend some days on googling, but as for now - without any effect.
----------
- Windows 7 64bit (build 7100)
- PHPInfo -> Apache/2.2.13 (Win32) PHP/5.3.0
PDO drivers mysql, odbc, sqlite
PDO Driver for SQLite 3.x enabled
SQLite Library 3.6.15
SQLite3 support enabled
SQLite3 module version 0.7-dev
SQLite Library 3.6.15
Directive Local Value Master Value
sqlite3.extension_dir E:\Program Files (x86)\PHP\ext E:\Program
Files (x86)\PHP\ext
---------------
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_SQLITE3]
extension=php_sqlite3.dll
both DLL's are in ext folder.
------
Everything works fine, till I wanted to embed database support. On
"Fatal error: Call to undefined function sqlite_open()"
(trying 1 argument and/or 3 arguments function call)
I start to wonder if it is compatible with 64bit system, but
everything looks loaded and properly configured.
Help..?
Hi.
Post by RRybak
From http://fr2.php.net/manual/en/sqlite.installation.php, "SQLite 3 is
supported through PDO SQLite
<http://fr2.php.net/manual/en/ref.pdo-sqlite.php>.".

You will find SQLite PDO doc here
http://au2.php.net/manual/en/ref.pdo-sqlite.php.
Ryan Schmidt
2009-11-17 22:51:19 UTC
Permalink
There are several different SQLite interfaces in PHP. Sounds like you've enabled two of them, but are now trying to use a third one that you haven't enabled.
Post by RRybak
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
That extension provides this interface:

http://php.net/pdo-sqlite
Post by RRybak
[PHP_SQLITE3]
extension=php_sqlite3.dll
That extension provides this interface:

http://php.net/sqlite3
Post by RRybak
both DLL's are in ext folder.
------
"Fatal error: Call to undefined function sqlite_open()"
That function is from this interface:

http://php.net/sqlite
RRybak
2009-11-25 16:55:35 UTC
Permalink
Indeed, I was using bad driver. Took me some time, to get it, migrating from
mysql (sqlite versions, pdo etc.).
So if anyone ever has problems with sqlite and PHP, the solution is PDO.

For the google spider:

Following http://www.php.net/manual/en/pdo.construct.php:
$db = new PDO('sqlite:filename.db');

Also it is misleading, that PDO does not output any errors, as mysql did..
The proper check of last error (even SQL one) is done by:

print_r($db->errorInfo());

..but that is another story.

Thank you for you suggestions. It finally works :)

Loading...