Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

CGI Newbie Question - what happened to the original question?

by Tuna (Friar)
on Jun 30, 2001 at 08:20 UTC ( [id://92871]=perlquestion: print w/replies, xml ) Need Help??

Tuna has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to set up this trouble ticket system and it's driving me nuts!!! I have checked, rechecked, then checked againe to ensure that variables and permissions are set correctly. In fact, with each script/library included in this package, I ran

perl -cw script-nameand aside from the "filehandle used only once" warnings I get because the person who wrote this didn't "use strict", or -w, each component passes syntax check.

Additionally, I can run the code by hand, redirect the output to an html doc, and bring it up in my browser, no problem.

For brevity's sake, I am not posting 283 lines of code, but follow the link above, and you'll find the packacge I am referring to. The specific file that is causing me problems is index.cgi. My Apache error log says,

[Fri Jun 29 21:47:17 2001] [error] (2)No such file or directory: exec +of /var/www/cgi-bin/index.cgi failed [Fri Jun 29 21:47:17 2001] [error] [client 127.0.0.1] Premature end of + script headers: /var/www/cgi-bin/index.cgi
HEELLLLPPPP!!!!

Replies are listed 'Best First'.
Re: CGI Newbie Question - what happened to the original question?
by tachyon (Chancellor) on Jun 30, 2001 at 15:05 UTC

    First I get a 404 not found trying to download the code :-(

    Without the code you get guess work but from your error log the script is calling for a file that does not exist which could be anyting from the perl executable to a module to a flat file to a database. The premature end of script headers occur becuase this error is output to STDOUT before the script header info.

    This is the mostly complete text of a tutorial I have written on how to get your CGI scripts working - there are a few links I have yet to get round to adding but as you sound desperate I will post it here for you.... It will eventually get posted here when I get time to finish it. <END_EXCUSE_THE_TYPOS_ETC_BLOCK> It should help as this appears to be a commercial script so the problem is likely at your end with the config. I recommend the BEGIN block especially and D.2 seems relevant.

    Sorry can't help more but no code you know...

    cheers

    tachyon

    This node is being developed to help you get your CGI script working. It is not a Perl tutorial and focuses on CGI issues. It owes much to Tom Christiansen's terse but informative The Idiot's Guide to Solving Perl CGI Problems. I recommend you check this out if you can not find the answers you need here.

    What follows is a sort of checklist to help you solve the problem quickly yourself. It is divided into four parts: 

    A. Before uploading to the Server

    B. Uploading to the Server

    C. Setting Up on the Server

    D. Debugging

     

Re: CGI Newbie Question - what happened to the original question?
by ginseng (Pilgrim) on Jun 30, 2001 at 09:21 UTC

    blind leading the blind...i'd check the link on the first line of the script. probably reads /usr/local/bin/perl, rather than /usr/bin/perl or vice versa.

    try which perl on your system to see what it should read ;)

Re: CGI Newbie Question - what happened to the original question?
by Beatnik (Parson) on Jun 30, 2001 at 17:48 UTC
    My guess would be your uploading method. That kind of error occurs when you're uploading scripts in BINARY mode instead of ASCII mode.

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
Re: CGI Newbie Question - what happened to the original question?
by sierrathedog04 (Hermit) on Jun 30, 2001 at 18:13 UTC
    You said that permissions are correct, but for which user?

    Make sure that you can run your scripts from the command line as the exact user that your webserver runs under. In UNIX if you do not have permission to view a file then the OS will sometimes return a file not found error.

    If you know the file exists and you hard code the path and the server still cannot find the file then the problem is probably one of a lack of permissions for the user under whose account the webserver executes.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://92871]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (None)
    As of 2024-04-25 00:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found