Can't write to a text file through CGI-Perl

Discussion in 'Perl Misc' started by Kishore, Aug 30, 2004.

  1. Kishore

    Kishore Guest

    Hi,

    I have perl program and it writes some data to a text file that is in
    cgi-bin/log. And this file does not exist. So the program creates it
    and then writes to it.

    When I run the perl program from shell it creates and writes to the
    text file fine.

    But when I run the same program from http as a cgi, it gives me an
    error saying that I do not have permission to create or write to this
    file.

    The cgi-bin has 0755 and log directory in cgi-bin also has 0755
    permission settings.

    Is there anything else I should do.

    When I run from shell, I login as root.

    Thanks for your help in advance.

    Kishore.
    Kishore, Aug 30, 2004
    #1
    1. Advertising

  2. Kishore wrote:
    > I have perl program and it writes some data to a text file that is in
    > cgi-bin/log. [...]
    > When I run the perl program from shell it creates and writes to the
    > text file fine.


    Then it is extremely unlikely that you have a Perl issue.

    [...]
    > Is there anything else I should do.


    You should read the FAQ, in particular "perldoc -q 500"

    jue
    Jürgen Exner, Aug 30, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anukul Singhal
    Replies:
    3
    Views:
    161
  2. fatted
    Replies:
    1
    Views:
    129
    Steve Grazzini
    Jul 25, 2003
  3. JR
    Replies:
    7
    Views:
    165
    Tore Aursand
    Oct 20, 2003
  4. kath
    Replies:
    4
    Views:
    580
    J. Gleixner
    Apr 9, 2007
  5. Rich Grise

    Can I iterate through a file on a CGI page?

    Rich Grise, Apr 2, 2008, in forum: Perl Misc
    Replies:
    14
    Views:
    362
    Rich Grise
    Apr 15, 2008
Loading...

Share This Page