Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

cgi weirdness

 [1/10] from: jamescis152::hotmail::com at: 3-Dec-2001 14:30


The strange thing is that my old scripts work. I'm using the -cs option that I have used for years. hmmmmm. This is really bugging me. Help. Thanks, James Submit: Send Message I don't know why but for some reason I can't get NEW cgi scripts to work properly. I constantly get the REBOL help output listing (you know the one that you get when you ask for help) when I run a cgi program. I've broken it down to the simplist of scripts including one of the sample ones. The strange thing is that my old scripts work. I'm using the -cs option that I have used for years. hmmmmm. This is really bugging me. Help. Thanks, James

 [2/10] from: brett:codeconscious at: 4-Dec-2001 10:49


Hi James, I'm not an expert on CGI but to me it appears that the webserver does not recognise your script as a CGI so it just picks it up and sends it out as the content itself, rather than executing it. I would guess then that it has nothing to do with Rebol, more likely it is file permissions for your scripts or some sort of server configuration. So check the file permissions of the old scripts and compare them against the new. Presumably you are using the same file extension for both and you are running them from the same directory. Brett. ----- Original Message ----- From: <[jamescis152--hotmail--com]> Sent: Tuesday, December 04, 2001 9:30 AM Subject: [REBOL] cgi weirdness
> The strange thing is that my old scripts work. I'm using the -cs option
that I have used for years. hmmmmm. This is really bugging me.
> Help. > > Thanks, > James > > Submit: Send Message > > I don't know why but for some reason I can't get NEW cgi scripts to work
properly. I constantly get the REBOL help output listing (you know the one that you get when you ask for help) when I run a cgi program. I've broken it down to the simplist of scripts including one of the sample ones.

 [3/10] from: gchiu:compkarori at: 4-Dec-2001 13:45


On Tue, 4 Dec 2001 10:49:12 +1100 "Brett Handley" <[brett--codeconscious--com]> wrote:
> I'm not an expert on CGI but to me it appears that the > webserver does not > recognise your script as a CGI so it just picks it up and > sends it out as > the content itself, rather than executing it. I would
Hmm. Then he wouldn't see the Rebol help screen though. I've had the same problem recently as well - haven't had a chance to see why ... -- Graham Chiu

 [4/10] from: brett:codeconscious at: 4-Dec-2001 14:52


oops. That's true, I missed that crucial piece of evidence. :-/ Brett.

 [5/10] from: petr:krenzelok:trz:cz at: 4-Dec-2001 5:59


Hi, I will help you :-) Well, I lost hours checking my environment, as I am no linux guru. And you know what? The problem was in damned spacing. I strongly suggest you following: read your script into rebol, detab it, save it once again. It matters especially when you transfer your scripts between various platforms: ->> write %my-script.cgi detab read %my-script.cgi Just yesterady I had similar problem. Even detab was not enough. I cut and pasted first line from another script (#!/usr/bin/rebolcmd -cs), detabbed the script, manually pressed enter at the end of the line, deleted empty lines, entered new ones, etc. - no success. I simply deleted line above and typed it from scratch manually - oops - script started to work. It already happened to me two times .... Cheers, -pekr- [jamescis152--hotmail--com] wrote:

 [6/10] from: tomc:darkwing:uoregon at: 3-Dec-2001 21:26


In the enviroment I must use all cgiscripts must end in .cgi so the solution is to begin each script with a shebang line #! /path_to_rebol/rebol -cs rebol[] ... as an aside: I also use so adorned scripts as 'normal' shell commands as my co-workers typicaly can't/don't want to deal with the interperter suprisingly (delightfuly) rebol ignores the leading line and the scripts run either from a shell or rebol prompt. On Tue, 4 Dec 2001, Brett Handley wrote:

 [7/10] from: gchiu:compkarori at: 4-Dec-2001 19:56


> Just yesterady I had similar problem. Even detab was not > enough. I cut and pasted first line from another script
<<quoted lines omitted: 4>>
> and typed it from scratch manually - oops - script > started to work. It already happened to me two times ....
Hmm. Shouldn't Rebol be more robust than this? -- Graham Chiu

 [8/10] from: sanghabum:aol at: 4-Dec-2001 4:52


> Just yesterady I had similar problem. Even detab was not > enough. I cut and pasted first line from another script
<<quoted lines omitted: 4>>
> and typed it from scratch manually - oops - script > started to work. It already happened to me two times ....
I had a similar problem the first time I tried a CGI script. It drove me bonkers and had me installing and reinstalling software until the "Ah-ha!" happened. My problem was related to CGI scripts and line termination.....There are three ways to terminate a line (CR, LF and CRLF), Between them, MAC OS, Unix/Linux, and WIN/DOS use all three. Apache (for example) only likes one type of termination, regardless of the OpSys it is running under, So #!rebol/rebol.exe -CSI Rebol [] may look good, but Apache may be misreading the line endings and see it as #!rebol/rebol.exe -Rebol [] Which won't work at all. If you are on Windows, as far as I remember any text editor will produce line endings that Apache will accept. You can, though demonstrate the problem by saving an MS Word file as ASCII. Apache won't parse that properly. Any help? Colin.

 [9/10] from: ingo:2b1 at: 4-Dec-2001 11:38


Hi James, another guess: some servers choke on wrong line endings, e.g. a script written under windows, and then executed on a Unix machine ... If possible, try REBOL[] write %my-cgi-script.r read %my-cgi-script.r on the server. I hope that helps, Ingo Once upon a time Brett Handley spoketh thus:

 [10/10] from: jamescis152::hotmail::com at: 6-Dec-2001 1:06

CGI Weirdness Solved!!!


First of all thank you to my fellow Rebol Netizens for your responses. Petr Krenzelok <[Petr--Krenzelok--trz--cz]>'s note about detab'ing got me thinking about what was wrong. I had to FTP the scripts using the ASCII mode (duh!) as opposed to Binary or Auto (which may revert to Binary if not set to understand the .r extension I use.) I realized that I was using a different FTP client (ws_ftp) rather than my usual CuteFTP which I had set to ASCII mode for all my .r files. Hope this helps others who might inadvertently make the same mistake. Thanks again James Nakakihara

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted