dokufreaks/plugin-blogtng

"Fatal error: Call to undefined function sqlite_open()" after install

Closed this issue · 5 comments

Hi. I get the following error after installing blotng plugin on Windows XP with apache2 & PHP 5.3.2:

Fatal error: Call to undefined function sqlite_open() in C:\svn_branch_twitter\www\dokuwiki\lib\plugins\blogtng\helper\sqlite.php on line 44 Call Stack: 0.0151 360504 1. {main}() C:\svn_branch_twitter\www\dokuwiki\doku.php:0 4.2020 8268816 2. trigger_event() C:\svn_branch_twitter\www\dokuwiki\doku.php:78 4.2021 8269352 3. Doku_Event->trigger() C:\svn_branch_twitter\www\dokuwiki\inc\events.php:196 4.2021 8269384 4. Doku_Event->advise_before() C:\svn_branch_twitter\www\dokuwiki\inc\events.php:85 4.2021 8269496 5. Doku_Event_Handler->process_event() C:\svn_branch_twitter\www\dokuwiki\inc\events.php:56 4.2022 8269856 6. action_plugin_blogtng_linkback->check() C:\svn_branch_twitter\www\dokuwiki\inc\events.php:171 4.2064 8294016 7. helper_plugin_blogtng_linkback->linkbackAllowed() C:\svn_branch_twitter\www\dokuwiki\lib\plugins\blogtng\action\linkback.php:40 4.2064 8294016 8. helper_plugin_blogtng_linkback->getPost() C:\svn_branch_twitter\www\dokuwiki\lib\plugins\blogtng\helper\linkback.php:15 4.2066 8294128 9. helper_plugin_blogtng_entry->load_by_pid() C:\svn_branch_twitter\www\dokuwiki\lib\plugins\blogtng\helper\linkback.php:25 4.2067 8294464 10. helper_plugin_blogtng_sqlite->query() C:\svn_branch_twitter\www\dokuwiki\lib\plugins\blogtng\helper\entry.php:57 4.2068 8294464 11. helper_plugin_blogtng_sqlite->_dbconnect() C:\svn_branch_twitter\www\dokuwiki\lib\plugins\blogtng\helper\sqlite.php:126

Pleas help.

Thanks.
Andrew

As mentioned on the plugin page you need to install and enable the SQLite extension for PHP.

Thanks for your prompt reply michitux. Much appreciated! I checked the phpinfo() and it shows:

PDO support enabled
PDO drivers mysql, odbc, sqlite

PDO Driver for SQLite 3.x enabled
SQLite Library 3.6.22

SQLite3 support enabled
SQLite3 module version 0.7-dev
SQLite Library 3.6.22
Directive Local Value Master Value
sqlite3.extension_dir no value no value

When I look at the Debian file list - http://packages.debian.org/sid/i386/php5-sqlite/filelist - it lists:

  • /usr/lib/php5/20090626+lfs/pdo_sqlite.so
  • /usr/lib/php5/20090626+lfs/sqlite.so
  • /usr/lib/php5/20090626+lfs/sqlite3.so

When I look at the Windows XP PHP extension directory, it lists:
C:\Program Files\PHP\ext>dir sqlite

  • 03/03/2010 07:46 PM 507,982 php_pdo_sqlite.dll
  • 03/03/2010 07:46 PM 516,171 php_sqlite3.dll

Does blogtng require sqlite 'version 2' which I presume would be something like 'php_sqlite.dll'?

Or, do I need to install a separate, stand-alone library and put this in my system environment variable 'path' - http://sqlite.org/download.html - ?

Sorry for all the questions, but I'm just confused by being able to see sqlite3 via phpinfo() and then getting the FATAL ERROR which makes it appear that the php sqlite extension is not installed. Wierd.

Cheers.
Andrew

Which sqlite extension does blogtng need/want? sqlite2 or sqlite3?

Found this url: http://blog.andreas-haerter.com/2011/05/15/how-to-create-a-dokuwiki-blog-blogtng-plugin which mentions the following 2 points:

  • Unlike DokuWiki itself, BlogTNG is using a SQLite database for its metadata and comments. But don't worry, this makes the DokuWiki administration and backup not complicated. SQLite is bundled with PHP 5 and enabled by default. The database itself is just a blogtng.sqlite file at DokuWikis meta data directory and therefore you can still backup everything by simply downloading it.
  • The blogtng.sqlite file is currently a SQLite 2 database.

So blogtng is definitely using sqlite2, however not all php installs are still including sqlite2 support. I've been running into this exact problem on CentOS 5 too. The easiest solution around this I've found thus far is to build the sqlite.so module and include it your self. Directions on how to accomplish this can be found at this url: http://zaemis.blogspot.com/2010/01/php-and-sqlite2-on-centos.html. These may prove helpful in getting sqlite2 support included in window's as well. HTH.

I will close this issue as the problem is solved by using sqlite2. The change to sqlite3 (or other databases) is handled in issues #71 and #74.