using "opendir" through a CGI script on Apache

Discussion in 'Perl' started by Alex, Feb 9, 2004.

  1. Alex

    Alex Guest

    Greetings all,

    I'm trying to use the "opendir" command on Win32 in a CGI script. I'm
    using Apache 2.0.48 for Win32.

    The "openDir" command works from the CGI script when I try to open a
    folder located on my local system. When I try to "openDir" a network
    drive using the CGI script run through Apache, Apache gives me the
    error: Can't openDir... However, when I run the CGI script in a DOS
    window, the command works properly.

    Is it possible to use "openDir" in a CGI script, run through Apache?
    What do I need to do to get it to work, is it a permission thing with
    the Apache user?

    Any help would be greatly appreciated.

    Cheers,

    Alex.
     
    Alex, Feb 9, 2004
    #1
    1. Advertising

  2. Alex wrote:
    > Is it possible to use "openDir" in a CGI script, run through
    > Apache?


    Yes, of course.

    > What do I need to do to get it to work, is it a permission thing
    > with the Apache user?


    It's safest to specify the full path to the directory.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Feb 9, 2004
    #2
    1. Advertising

  3. Alex

    Alex Guest

    Thanks for the post, I figured it out in the end...

    Apache 2 runs as a service in Win32. The apache2 service runs as the
    default system user which doesn't have any network permissions at all.
    The best thing to do is to set up a new user with the domain
    permissions you need, and get the service to log on as that user.
    Drat, should have figured it out sooner!!!

    ...xelA




    Gunnar Hjalmarsson <> wrote in message news:<OXTVb.82159$>...
    > Alex wrote:
    > > Is it possible to use "openDir" in a CGI script, run through
    > > Apache?

    >
    > Yes, of course.
    >
    > > What do I need to do to get it to work, is it a permission thing
    > > with the Apache user?

    >
    > It's safest to specify the full path to the directory.
     
    Alex, Feb 10, 2004
    #3
    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. Andrew

    opendir()

    Andrew, Sep 3, 2003, in forum: Perl
    Replies:
    2
    Views:
    9,477
    John Bokma
    Sep 3, 2003
  2. Tom Salzmann
    Replies:
    3
    Views:
    275
  3. geek

    Script dying at opendir()

    geek, Apr 27, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    121
    Tad McClellan
    Apr 27, 2005
  4. BestFriend
    Replies:
    2
    Views:
    823
  5. kath
    Replies:
    4
    Views:
    700
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page