Reputation: 415
I'm trying to get my project running on Dancer (perl 5.16.3 and centos 5.10), and so far it was pleasant experience - until I tried to deploy it on server.
I've decided to do the simplest thing and run it as CGI app with help of default dispatch.cgi script from Dancer distribution.
I used default apache settings from Dancer::Deployment manual, but something went wrong. After a day of struggle with half-working project I deduced the following strange thing: while running through dispatch.cgi, my project is able to read from sqlite database, but it cannot write into database, so Dancer::Session::DBI was not working properly and hence the problems.
If I run the project with stand-alone app.pl or with
plackup -E production -p 80 bin/app.pl
it works fine and able to insert data into DB. I've tried to change permissions to 0666 on sqlite db file, but it didn't help.
So why there's a problem with sqlite while running as CGI, and how to fix this?
Upvotes: 1
Views: 240
Reputation: 415
Well, it was permissions problem, but not for the dbase file - for directory contained that file! Apparently, sqlite creates some temp files while updating bases. Beware.
Upvotes: 1