0

I need to connect to a sqlite database using php. I have installed sqlite on my local system and configured a web server on a linux machine (our local server.) When I execute the php file on the linux machine, it does not work, it just shows a blank page.

Do I need to install both sqlite and php on the same machine?

3 Answers 3

2

SQLite is not really a DBMS, but more like a flat file with some API to operate it in the manner of SQL database.
there is no server or demon to connect to, but merely a file to open. So, there is nothing to install.

Install PHP only and then uncomment SQLite module in php.ini.
Then just open sqlite file in your code.
That's all.

Sign up to request clarification or add additional context in comments.

7 Comments

but i have installed php in linux server and sqllite in local windows machine. this will work on not
@ayathas you just have to copy your sqlite file to the linux machine.
i have searched the php.ini(i got the folder path from phpinfo()). i couldn't able find the word 'SQLite', but sqlite.ini was created in 'php.d'folder
@ayathas What are you trying to do? And why? Only thing you need are: 1. check phpinfo() for sqlite support. 2. copy your file to linux and open it in your php script
@ayathas if option 1 fails, you'd better ask another question, asking how to enable sqlite for PHP. Provide as much information as you could: operation system, software versions, path to files you tried to edit, etc.
|
0

Yes it is. How can you use sqlite if it's not installed?

You can easy install it from your destribution repository, i.e. on ubuntu just do sudo aptitude install php5-sqlite sqlite

2 Comments

i have installed both. my question is i have installed php in linux server and sqllite in local windows machine. this will work on not
It wont. AFAIK has sqlite no feauture which allows to run it as a independent daemon on the other machine. A sqlite db is "just a file", which is read by a special library. So you will have to have access to this file via php on the linux server. You can ofcourse mount you windows server via NFS or Samba on your linuxserver and then work with you sqlite db file on the windows server, but i think this is overkill :D
0

SQLite is an embedded database. The database files are always used locally, and the appropriate library must be installed in order to access them. So yes, PHP and SQLite must be installed on the same machine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.