strage things happening with Rev cgi 2.5
J. Landman Gay
jacque at hyperactivesw.com
Sun Mar 4 23:01:09 EST 2007
jbv wrote:
> I think I have already posted on this topic a few weeks ago,
> but didn't get any reply.
>
> I have a Rev cgi script that runs fine on a Linux RH server.
> the script is about 400 lines long.
>
> In that script, I have a couple of lines that creates a path file in
> a directory on the server, opens the file, writes the content
> of a couple of variables in it and then closes the file.
> something very simple that I'm using for debugging.
>
> When my script is OK, I comment those few lines (with --
> at the beginning of each line) because I don't need them anymore.
>
> And right after that I get a systematic error 500 when running the
> script. If I uncomment the same lines, the script runs fine again.
> If I delete those lines, error 500 again...
>
> I'm puzzled because I have plenty of other comments in the same
> script, that have no effect on it...
>
> This problem seems to happen now and then on some scripts only...
I'm thinking this has to be a script error. The error 500 almost always
is. The best thing to do would be to look in your system error log and
see what it says. There will often be a pointer there that tells you
which line of script is causing the error.
I don't think it is a commenting error. I've never had any trouble
adding comments to cgi scripts, and your script has other commented
lines that work. I think it is more likely that something else is
happening, like a line that refers to a variable which was declared in
the commented line. Look for something like that.
If the system error log doesn't tell you much, then you can start adding
bits of code to your script to try and find the problem. This is usually
a tedious process, but sometimes it is the only way. Add commands to the
script that write to the browser any info you want to track. For
example, have it send back the values of different variables at
scattered intervals throughout the script.
An easier way, if it is possible, is to just run your script from within
a stack in the IDE. Walking through it with the debugger will usually
give you lots of info.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list