1

Is it possible to access a sqlite database file in a remote server with PHP? I have enabled read access on the databse.db file and tried this:

$dbconn = new SQLite3("http://www.foo.com/database.db");

but it doesn't work:

Fatal error: Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file

Chin
  • 19,717
  • 37
  • 107
  • 164
  • 2
    possible duplicate of [Connect to a remote sqlite3 database with Python](http://stackoverflow.com/questions/2318315/connect-to-a-remote-sqlite3-database-with-python) – Ignacio Vazquez-Abrams Sep 10 '13 at 05:59

2 Answers2

2

SQLITE is not for this operation, but we can do a trick :) .

  1. create a RESTful server-api that can be put in the remote server to control what you need.
  2. create a RESTful client-api that can be the client you use to connect with the remote RESTful server .

NOTE: this is just for fun as by this trick we created server/client api to simulate server/client db using your programming lang and sqlite :)

1

I think you can't connect like this. You can't open the sqlite database which is hosted on remote server, because you may need the update permission of that file.

So you can download that file in your server parametrically then can connect that file which you downloaded.

Thanks

Sarwar Hasan
  • 1,561
  • 2
  • 17
  • 25