[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: can't exec some CGI scripts



Sorry, but I'm not sure I believe you :) - the -w switch is well
documented and never, under any circumstances, affects what goes to STDOUT
(or anywhere other than STDERR, which ends up in your log). When you say
"the script will run", do you mean that it does so *correctly*, that is,
that you get the expected output from your browser?

What is the output of perl -V? How about perl -wc newspro.cgi?

----------------------------------------------------------------------
Andrew J Perrin - Ph.D. Candidate, UC Berkeley, Dept. of Sociology  
Chapel Hill, North Carolina, USA - http://demog.berkeley.edu/~aperrin
        aperrin@socrates.berkeley.edu - aperrin@igc.apc.org
On Tue, 20 Feb 2001, John May wrote:

> 
> Unfortunately the problem is, 1. It isn't my script, I downloaded it from
> another site, and the other users report no problem like I am having and
> 2. I can't remove the -w option from the Perl line and still have the
> script work.  As soon as I remove -w, the script won't execute and I get
> an Internal Server Error in my browser window.
> 
> On Tue, 20 Feb 2001, Andrew Perrin wrote:
> 
> > I can't speak off the top of my head to the exec problem you're
> > having; the -w problem is clear. -w turns on warnings in perl, which are
> > essentially non-fatal errors regarding programming style and
> > structure.  The "Name %s used only once" warning tells you that the given
> > variable appears to be either only read or only written to in the
> > script, but not both, so you may have made a typo. The "Use of
> > uninitialized value" warning tells you that you've tried to read a
> > variable or array element that is undefined when you try to read
> > it; again, it signifies the possibility that your script is trying to
> > read a variable that has no value.
> >
> > If your script works passably otherwise, you can *technically* just remove
> > the -w from the shebang line and you should be fine. However, the Right
> > Way (tm) is to fix the problems and leave -w in.
> >
> > Cheers,
> > Andy Perrin
> >
> > ----------------------------------------------------------------------
> > Andrew J Perrin - Ph.D. Candidate, UC Berkeley, Dept. of Sociology
> > Chapel Hill, North Carolina, USA - http://demog.berkeley.edu/~aperrin
> >         aperrin@socrates.berkeley.edu - aperrin@igc.apc.org
> > On Tue, 20 Feb 2001, John May wrote:
> >
> > >
> > >
> > > On Tue, 20 Feb 2001, Erdmut Pfeifer wrote:
> > >
> > > I can execute the CGI scripts from the command line, when I use:
> > >
> > > $ perl newspro.cgi
> > >
> > > Also, below is a sample of the errors I get in my Apache error_log file
> > > when I run the scripts from a web browser with the #!/usr/bin/perl -w
> > > option.  BTW, I get these types of errors no matter which script I try to
> > > run.
> > >
> > > [Tue Feb 20 14:58:46 2001] [notice] Apache/1.3.17 (Unix) configured --
> > > resuming normal operations
> > > Name "main::SilentBuild" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 969.
> > > Name "main::nplang_12Hour" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 1498.
> > > Name "main::nplangversion" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 238.
> > > Name "main::glossaryon" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 744.
> > > Name "main::EnableDailyArchiving" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 1575.
> > > Name "main::nplibBuild" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 235.
> > > Name "main::nplang_DateFormat" used only once: possible typo at
> > > /home/www/cgi-bin n/newspro/newspro.cgi line 1501.
> > > Name "main::JustLoadSubs" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 113.
> > > Name "main::ChangedItems" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 1227.
> > > Name "main::npconfigversion" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 232.
> > > Name "main::FormFieldsModifySize" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 1133.
> > > Name "main::ArcHtmlExt" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 800.
> > > Name "main::newtime" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 817.
> > > Name "main::newsdate" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 816.
> > > Name "main::NewsID" used only once: possible typo at
> > > /home/www/cgi-bin/newspro/newspro.cgi line 761.
> > > Use of uninitialized value at /home/www/cgi-bin/newspro/newspro.cgi line
> > > 1277.
> > > Use of uninitialized value at /home/www/cgi-bin/newspro/newspro.cgi line
> > > 1277.
> > > Use of uninitialized value at /home/www/cgi-bin/newspro/newspro.cgi line
> > > 1277.
> > >
> > > > On Tue, Feb 20, 2001 at 11:20:11AM -0500, John May wrote:
> > > > > I am using Apache 1.3.17 (compiled from source) on Debian Woody.  When I
> > > > > try to exec some CGI scripts, by typeing in the URL, ex.
> > > > > http://www.cybergeek.org/cgi-bin/newspro/newspro.cgi, I get an an
> > > > > Internal Server Error with the following error in Apache's error log:
> > > > >
> > > > > [Tue Feb 20 08:55:23 2001] [error] (2)No such file or directory: exec of
> > > > > /home/www/cgi-bin/newspro/newspro.cgi failed
> > > > >
> > > > > [Tue Feb 20 08:55:23 2001] [error] [client (ip address)] Premature end
> > > > > of script headers: /home/www/cgi-bin/newspro/newspro.cgi
> > > > >
> > > > > I have made sure that the path to Perl is correct in the scripts and
> > > > > that the correct permissions are set.  I also made sure that my
> > > > > ScripAlias directory was correct.  I can run other scripts, like the
> > > > > test-cgi script and the printenv script, but not any others.  Also if I
> > > > > add a (-w) to the Perl statement at the begginning of the script, i.e.
> > > > > #!/usr/bin/perl -w  then the script will run, but a whole lot of
> > > > > debugging information fills up the error logs.  I have scoured the
> > > > > maillist archives for any solution, but came up empty handed.  Any help
> > > > > would be appreciated.
> > > >
> > > > Can you run the script normally outside of apache -- it may not do
> > > > what you want it to do, then, but does it start properly?
> > > >
> > > > It might also be useful if you would post the info you get in the error
> > > > log when using "-w".
> > > >
> > > > Erdmut
> > > >
> > > >
> > > > --
> > > > Erdmut Pfeifer
> > > > science+computing gmbh
> > > >
> > > > -- Bugs come in through open windows. Keep Windows shut! --
> > > >
> > >
> > >
> > > --
> > > To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> > > with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> > >
> > >
> >
> >
> 
> 



Reply to: