suddenly not working -- Rev cgi plus mysql on webhost (DreamHost)

Nicolas Cueto niconiko at gmail.com
Thu Mar 26 03:33:42 EDT 2009


Success!

Here's the solution, which I happened to find
in the archives.

First, I replaced the older engine and database
drivers (2.6 they were, I think) with the 2.9 engine
and the database drivers (externals?), i.e.,
revdb.so and dbmysql. All are Linux since that's
what my webhost's server runs, and all get placed
in the same directory I use for rev-cgi work.

(Side note # 1: Still curious about why the 2.6 engine
and the new server set up didn't get along.)

Then, I added the following lines to my rev-cgi script:

  put "/[PATH TO CGI DIRECTORY]/revdb.so" into tExternals
  set the externals of the templatestack to tExternals
  create stack "externals"
  start using stack "externals"
  revSetDatabaseDriverPath "/[PATH TO CGI DIRECTORY]"
  put revOpenDatabase([MYSQL DATABASE PARAMETERS]) into connid
  ##  Do whatever mysql stuff needs doing...
  revCloseDatabase connid
  close stack "externals"

What's important about this is that it first specifies the
path to the database external and then starts up that
external by creating and starting a temporary dummy
stack. This appears to activate the database external
revdb.so, and thus enables any database-related
commands that follow (revSetDatabaseDriverPath,
revOpenDatabase, and so on).

(Side note # 2: Isn't it reasonable to think that as soon
as the Rev engine gets started by the almighty "#!rev -iu"
this would also execute all externals in the same directory
as the engine?)

Glad to see a happy end to days and days of frustration.

-- Nicolas Cueto



More information about the use-livecode mailing list