Page 1 of 1

linux server errors with sqlite and v 2.9

Posted: Sun May 04, 2008 11:08 am
by flume
I am using version 2.9
I have a problem trying to use my sqlite database on a linux server
I have a standalone application working very well and using a sqlite database file.
I have uploaded the sqlite database chmod 755 into the cgi-bin folder
I have uploaded the following cgi file and chmod 755 and with UNIX file format

#!revolution -ui
on startup
library "minimal.rev"
end startup

I have uploaded a very simple stack with the following stack script.

on librarystack
get revOpenDatabase("sqlite",".Dances.s3db",,,,)
end librarystack

on calling the cgi in firefox I get the dreaded 500 server error.
on checking the server logs it reports clearly "execution error on line 2 char 5".

Obviously from the above I have whittled the code down to identify the problem.

I have also tried using another linux server but with the same result.

For the record other cgi's I have tried work fine.

I wondered if this is an ISP problem as a previous request to our superb team in Edinburgh although full of ideas obviousy expected this code to work.

Can anyone duplicate this error ?

Help would be most gratefully appreciated as I can see no way forward.

Posted: Sun May 04, 2008 11:26 am
by Mark
Flume,

It looks like your CGI engine is unaware of the SQLite external. You don't write that you have set the path to the external correctly.

Best,

Mark

Posted: Sun May 04, 2008 2:37 pm
by BvG
I got mysql working with the following script (sugested by mark waddingham):

Code: Select all

#!/home/user/rev/rev -ui

on startup
  --setup mySQL
  set the externals of the templateStack to "/home/user/rev/revdb.so"
  create stack "externals"
  start using stack "externals"
  revSetDatabaseDriverPath "/home/user/rev"
  --normal cgi stuff here

  -- As we have created a stack we need either quit or delete
  -- stack at the end.
  delete stack "externals"
end startup
Note that I have put all executable files (besides the cgi itself) outside of the cgi-bin, an even outside the http folder. This is supposed to increase security.

the folder "/home/user/rev/" contains these files:
dbmysql.so --themysql external
rev --the engine
revdb.so --the general db external

Adjust accordingly for SQlite and the paths you want to use.

Posted: Wed May 07, 2008 10:07 am
by flume
Thanks BvG and Mark.

Clever bit of scripting to get the externals recognised.

Happy to report I have sqlite working and extracting and displaying data.

Now for some fun with forms !!