in reply to Execution of shell script failing always inside cgi based perl program
Firstly, welcome to Perl Monks. Secondly, when posting there is advice displayed on how to format your post correctly, to make it easy for everyone to read. Please don't ignore this advice. For further info see How do I post a question effectively?.
Looking at your code the first thing I'd say is that you don't have:
use strict; use warnings;
anywhere. This should be at the start of your script, after the shebang line. Read Use strict and warnings from the tutorials section.
Is there a reason you aren't using CGI? See Ovid'sCGI Course and CGI Programming from the tutorials section of this site.
Have you checked the Apache error_log file to see what it says? It's a good place to start investigating such issues :)
Common reasons for shell scripts not running via CGI scripts include:
Insufficient privileges: does your shell script work from the command line when executed as the user running your web server/CGI scripts?
OS based security: Some web servers such as IIS6 won't execute shell or command line scripts out of the box. Is your web server configured correctly? Are you (or more to the point the server on which this script resides) running Security-Enhanced_Linux?
Martin
|
|---|