2
  1. In db.py,I can use a function(func insert) insert data into sqlite correctly.
  2. Now I want to insert data into sqlite through python-fastcgi, in fastcgi (just named post.py ) I can get the request data correctly,but when I call db.insert,it gives me internal server error.

I already did chmod 777 slqite.db. Anyone know whats problem?

2
  • It will be easier to help if you post some code. Commented May 29, 2012 at 4:26
  • turn on the debug flag of fastcgi, and find where is the bug. Commented May 29, 2012 at 5:49

1 Answer 1

4

Ffinally I found the answer:

the sqlite3 library needs write permissions also on the directory that contains it, probably because it needs to create a lockfile.

Therefor when I use sql to insert data there is no problem, but when I do it through web cgi,fastcgi etc)to insert data there would be an error.

Just add write permission to the directory.

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

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.