Recently, I’m working on my Skypiea project which is powered by SQLite3 and Python (as CGI script). Yesterday I encountered a program: When the web server ran a CGI script which would update the database, I got an error message said “sqlite3.OperationalError: unable to open database file“.
I searched the web and Google told me I need to specify the full path (no ~ or $HOME etc.) of the database file and the web server needs the write permission to the file. Sure, I actually had done both before the exception occurred.
Having being pissed for a while, I finally figured out what was wrong here: The web server needs the write permission to not only the database file, but also the containing directory of that file.
Yea, just simple like that.
