Revolution on GoDaddy

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Redlance305
Posts: 30
Joined: Sun Feb 28, 2010 9:52 pm
Location: Miami, Florida
Contact:

Revolution on GoDaddy

Post by Redlance305 » Sat Apr 17, 2010 2:10 am

If you have attempted to run a CGI script on GoDaddy, and even the BASIC app isn't running. Give them a call, seems the server my site was on had an 'issue' running CGIs. Took about 24 hours, but they fixed it.

The site now runs basic CGI's, but I'm unable to get a database application to work correctly. I've tested it on two Xserves (running Leopard Server). I've move over dbmysql.so and revdb.so and set all the permissions using their control panel. Very simple really.

HOWEVER, the app doesn't work. Unsure if it is a path error or some other newbe error.

----- So far the site only works in Safari (or on an iPhone/iTouch or iPad)
Site works here: (test site)
http://www.crossvilleonline.net/iphone/index.html

but doesn't work here: (which is where it belongs)
http://www.mdcps.info/iphone/index.html

MySQL_mdcps15.cgi is the problem file, or the file where I KNOW the issue is.

Anyone got any clues?

Andre and Andre's site (http://www.andregarzia.com) were a big help getting me as far as I've gotten!

Thanks
~David

Redlance305
Posts: 30
Joined: Sun Feb 28, 2010 9:52 pm
Location: Miami, Florida
Contact:

Re: Revolution on GoDaddy

Post by Redlance305 » Sun Apr 18, 2010 3:41 pm

Submitting a help request into runrev.

Running the app below (portion/edited) on GoDaddy Linux server, I am returned up to 'step 2'. Concluding that the error must be related to 'revSetDatabaseDriverPath'. I've tried numerous combinations of the Path and revdb.so and dbmysql.so.

There is no error now, it just exit/finishes the script up to 'step 2'.

Not enough information in the 'documentation' to gamble a guess as to the problem and no response on the forums after 2 days. Would like to have the site totally moved to GoDaddy this week.

Just need to move it ALL to the one web site and have it work. Not spread over two sites.

Oh. When the app is run with a combination of GoDaddy and my own Xserver (changing the .so to .bundle(s), and yes I checked set all the permissions) the site works correctly. Searches the databases, returns result(s). Wonderfully simple.

Having great luck with RunRev so far, switched from Realbasic. Really easier to program, MORE built in features and I love how it works on the web. Just the minor roadblocks, and limited documentation/examples is a bummer.

Coding Geek
~David

-------------------------------------------------------------------------------------------------------------------
#!/home/content/g/o/o/goodtimes352/html/cgi/standalone -ui
on startup
put "Content-Type: text/plain" & cr & cr
put "1241" into MailCode
put "SELECT * FROM Sites Where PartNumber='" into MySQLBuild
put "1241" after MySQLBuild
put "';" after MySQLBuild
put MySQLBuild & cr & "test" & cr
set the externals of the templateStack to "/home/content/g/o/o/goodtimes352/html/cgi/dbmysql.so"
put "step 2" & cr
revSetDatabaseDriverPath "../home/content/g/o/o/goodtimes352/html/mdcps/cgi/"
put "step 3" & cr
put revOpenDatabase("mysql", "goodtimesrental.db.5902959.hostedresource.com", "goodtimesrental", "goodtimes", "xxxx") into dbresult
put "mysql " & dbresult & cr
-------------------------------------------------------------------------------------------------------------------

oliverk
Site Admin
Site Admin
Posts: 53
Joined: Mon Feb 27, 2006 2:16 pm
Location: Edinburgh

Re: Revolution on GoDaddy

Post by oliverk » Mon Apr 19, 2010 3:55 pm

Hi David,

I just had a quick glance at your code sample and I think you're loading the database stuff not quite right. Try doing something like this (not tested):

Code: Select all

#!/home/content/g/o/o/goodtimes352/html/cgi/standalone -ui

on startup
   loadDatabaseDrivers
   -- Proceed with database related stuff...
end startup

# This should be called on startup
command loadDatabaseDrivers
   # This temporary stack is created to act as a wrapper for the database drivers,
   # once its been setup during startup the database stuff will just work, after the app
   # finishes running, it'll just be deleted from memory.
   local tWrapperStackName
   put "ExternalWrapper" into tWrapperStackName
   
   # Path to the revdb external
   local tRevDBPath
   put "/home/content/g/o/o/goodtimes352/html/cgi/revdb.so" into tRevDBPath
   
   # Folder containing the database drivers (i.e dbmysql.so etc)
   local tDriverPath
   put "/home/content/g/o/o/goodtimes352/html/cgi" into tDriverPath
   
   if tWrapperStackName is not among the lines of the stacksInUse then
      # Not actually required for CGI but useful if you move the code to desktop environment
      set the visible of the templateStack to false
      
      set the name of the templateStack to tWrapperStackName
      set the externals of the templateStack to tRevDBPath
      create stack
      
      # Inserts the stack into the global message path, allowing you to access the database library stuff
      start using stack tWrapperStackName
      
      # Once its loaded, tell revDB where the drivers are
      revSetDatabaseDriverPath tDriverPath
   end if
end loadDatabaseDrivers

Hope this is some help.
Regards
Oliver
Oliver Kenyon
Software Developer
Runtime Revolution

Redlance305
Posts: 30
Joined: Sun Feb 28, 2010 9:52 pm
Location: Miami, Florida
Contact:

Re: Revolution on GoDaddy

Post by Redlance305 » Wed Apr 21, 2010 12:25 am

Oliver

Seems we are doing 'about' the same thing. Granted yours is neater, but I'm shot gunning it trying to find the 'issue'.

GoDaddy was very helpful, did all the site upgrades I could. Turned on all the logs, etc. HOWEVER since I'm using a shared server, they don't have error logs that cover CGI errors. (so no help at all)..

Your code did give me a little guidance though. If the 'stack' is required ("ExternalWrapper"). AS is the server hangs on the code, not moving foreword, however if I comment out the statements noted below the system doesn't hang. NOTHING happens, but it doesn't hang. Plus once again my "steps' appear.

Did get a reply from runrev, not very helpful. Basically quoted a message I found already on the forums about MySQL,mysql being case sensitive. And saying that is is better to use "defaultfolder" than typing in the path.. (arg, not very helpful information)

So if a stack is required, what would cause a CGI to 'stall' a server request. How would I resolve?

Thank you for the help!
~david
-----------------------------------------------
if tWrapperStackName is not among the lines of the stacksInUse then
# Not actually required for CGI but useful if you move the code to desktop environment
#set the visible of the templateStack to false

#set the name of the templateStack to tWrapperStackName
#set the externals of the templateStack to tRevDBPath
#create stack

# Inserts the stack into the global message path, allowing you to access the database library stuff
#start using stack tWrapperStackName

# Once its loaded, tell revDB where the drivers are
revSetDatabaseDriverPath tDriverPath
end if

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”