Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Perl CGI with SQLite Windows and IIS

by bliako (Monsignor)
on Mar 20, 2018 at 11:25 UTC ( [id://1211304]=note: print w/replies, xml ) Need Help??


in reply to Perl CGI with SQLite Windows and IIS

Irrelevant to the DB issue but may make debugging easier:

In your CGI program always print the HTTP headers before you do anything else.

print "Content-Type: text/html\r\n\r\n";

in this way, any print statement (to STDOUT) from you or from a module you are calling will end up in the browser. Failure to print headers results in server response error 500 when anyone prints to STDOUT an innocent debug message.

Another helpful thing will be to redirect STDERR to a server-side log file using:

if( ! open(STDERR, '>>', '/tmp/log.txt') ){ ... }

In my experience, one may control own program's print statements but not 3rd party modules'.

Poj's suggestion for using

use CGI::Carp 'fatalsToBrowser';

covers some of the cases I mentioned

As per the DB problem in particular: you have to make sure that the DB itself but also the *directory* it resides in are writable by the OWNER-USER OF THE CGI script.

Lastly, multiple access to a DB will initiate file-locking making the DB temporarily read-only. I am not acquainted with SQLite but there may be stale lock files somewhere?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1211304]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-28 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found