linux server errors with sqlite and v 2.9

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
flume
Posts: 4
Joined: Fri Feb 22, 2008 8:54 pm
Location: Maidenhead
Contact:

linux server errors with sqlite and v 2.9

Post by flume » Sun May 04, 2008 11:08 am

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.
Flume

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun May 04, 2008 11:26 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Post by BvG » Sun May 04, 2008 2:37 pm

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.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

flume
Posts: 4
Joined: Fri Feb 22, 2008 8:54 pm
Location: Maidenhead
Contact:

Post by flume » Wed May 07, 2008 10:07 am

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 !!
Flume

Post Reply

Return to “CGIs and the Server”