Calling "system" in a script run from command line and calling "system" in a CGI script run under your web server are different because of the different environments.

When you are running a CGI script, it is running as the web server process owner (or an alternate set by your web server configuration). Most often this is set to the user "nobody". This user is limited with permissions as it is intended to incorporate behaviour of an unauthorized visitor.

The solution to your problem lies in diagnosing what exactly is going wrong. Most of the error output is going to be in your web server logs so you should check there first. If you cannot find information there or your web server is not configured to trap error info from CGIs, try running your CGIs from command line (just run them like regular programs and they will ask to form parameters etc).

If the CGIs work fine from command line, then it is most likely a permissions or environment issue. Try to use fully qualified parths for the system command. Check if the user "nobody" or your web process user can run the other programs Trap the output from the other programs to help diagnose the situation (have it write to the /tmp folder which is often globally writeable).

-- termix


In reply to Re: system cascade by termix
in thread system cascade by Mahoota

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.