in reply to Why can I not acess files outside cgi-bin directory?

Is the webserver CHROOTed?

If it is, then the path to access the file (if you can at all), would not be the same as it would on the hard drive.

I'm not sure what the implications are with CHROOT and windows, or if it's even possible, not being a windows user (well, for games, just not for servers).

I'm going to do with the basic rule of debugging CGI scripts -- read your error log. If you don't have access to the error log, for whatever reason, bug your admin.

  • Comment on Re: Why can I not acess files outside cgi-bin directory?

Replies are listed 'Best First'.
Re^2: Why can I not acess files outside cgi-bin directory?
by perlfeng (Initiate) on Mar 25, 2005 at 13:10 UTC
    Thanks a lot for your guys. The suggestions are all helpful. Now I have cleared the following issues:

    1. It is not because of the server since the server did not give the errors in error log.

    2. The script itself works fine without error or warning when it is running. Double backslash is required if put the file path in "" on windows. I will test if it is ok if put in '' and one backslash.

    3. It seems that the problem maybe related to windows OS as suggested by nerfherder. But I have no clue on it now.

    I would pin down the problem to the file format now. It seems that the text file can be read out from outside cgi-bin. I will b back soon if I got it solved.

    Thanks.

      Hi, All,

      I pinned down the problem to the data file itself because I can download other files outside of cgi-bin to the client. I suspected the data file was somehow damaged when I got it. But I still can open in a text editor. And strange enoght, I can open it in a local perl script!

      I also tested that it is not because the data file is too large as nobull suggested. Thanks for gam3 for reminding me that to use file path in '' with one backslash. It is much easy to read and comfortable.

      Thank you all again for giving advices on this question. It is helpful. Really appreciate it!