Search code examples
node-webkitnw.js

NW.js, php-webkit, sqlite3


I am researching converting a php/mysql web application I have, into a stand alone desktop application using NW.js (node-webkit), php-webkit, and a sqlite3 db in place of Mysql.

I have successfully installed all the necessary components to establish a sqlite3 connection and retrieve values from the database using similar examples to the ones found here: https://www.npmjs.com/package/sqlite3

The sqlite connection and retrieval of data works fine via the javascript examples.

Although when I try to connect to the same database from one of my PHP pages, no results are produced.

Is it not possible to connect to and retrieve info from my sqlite3 db from the PHP pages within a Node Webkit project running php-webkit? Has anyone successfully accomplished this, or is what I am trying to do essentially not possible?


Solution

  • I am the author of php-webkit. PHP is packaged with a copy of sqlite and php-webkit works with this. If you are having issues make sure the copy of PHP you included has the sqlite extension and sqlite enabled in your PHP.ini. Connecting to a stand alone copy of sqlite should be possible with the sqlite PHP extension. Here are some examples of connecting to sqlite from php.