Moodle
  1. Moodle
  2. MDL-13540

Problem in make_upload_directory under php 5.2.5 under IIS6

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.4
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
      None
    • Environment:
      IIS 6, PHP 5.2.5, Windows Server 2003 SP2, Moodle 1.8.4
    • Affected Branches:
      MOODLE_18_STABLE
    • Rank:
      4162

      Description

      As seen in http://moodle.org/mod/forum/discuss.php?d=90710 :

      Before I go on, I will make this very clear...the permissions ARE set correctly, the path to the moodle data IS correct.

      We've had Moodle working for quite some time now on PHP4. We took the decision to upgrade to 5.25 which went fine, but we now get the following error randomly when we use Moodle:

      ERROR: You need to create the directory E:\moodledata with web server write access

      Everything works ok, but we don't want the path of the moodle data being published like this.

      Anyone know why this is happening? PHP reports no errors, Moodle logs report no errors.

        Activity

        Hide
        Mathieu Petit-Clair added a comment -

        I can't tell exactly why this is happening, but since this message is shown in function "make_upload_directory" (in lib/setuplib.php), looking at the code I can guess that moodle sees the dataroot as being non-existent.. which is most probably not true.

        Maybe, it's the umask(0000) call (on line 113) ... as far as I know, umask just doesn't exist in Windows, so I don't know what it does. I don't have access to a windows server with IIS/PHP at this time to test this out, but I suppose it's also possible the webserver won't let you create a file with this kind of permission (world-read&writable).

        Show
        Mathieu Petit-Clair added a comment - I can't tell exactly why this is happening, but since this message is shown in function "make_upload_directory" (in lib/setuplib.php), looking at the code I can guess that moodle sees the dataroot as being non-existent.. which is most probably not true. Maybe, it's the umask(0000) call (on line 113) ... as far as I know, umask just doesn't exist in Windows, so I don't know what it does. I don't have access to a windows server with IIS/PHP at this time to test this out, but I suppose it's also possible the webserver won't let you create a file with this kind of permission (world-read&writable).
        Hide
        Petr Škoda added a comment -

        Or there is a bug in file_exists().

        Did you try the other PHP type (cgi/isapi)?

        Show
        Petr Škoda added a comment - Or there is a bug in file_exists(). Did you try the other PHP type (cgi/isapi)?
        Hide
        Rahim Virani added a comment -

        Mathieu,

        Did you grant write access to the user that is running IIS? Try looking for the user that runs IIS usually called IUSR_computername or some such, Grant that user write permissions to your data directory.

        Show
        Rahim Virani added a comment - Mathieu, Did you grant write access to the user that is running IIS? Try looking for the user that runs IIS usually called IUSR_computername or some such, Grant that user write permissions to your data directory.
        Hide
        miki Alliel added a comment -

        I'm having the same problem, I'v tried everything you said here and still having this error in the front page of my moodle site.
        The permissions are read\write to all and the config file is fine. I use isapi.
        why i'm still getting this error.
        "ERROR: You need to create the directory C:\moodledata with web server write access"
        please help
        thanks

        Show
        miki Alliel added a comment - I'm having the same problem, I'v tried everything you said here and still having this error in the front page of my moodle site. The permissions are read\write to all and the config file is fine. I use isapi. why i'm still getting this error. "ERROR: You need to create the directory C:\moodledata with web server write access" please help thanks
        Hide
        Richard L. Enison added a comment -

        I did a search of the Moodle Installation Problems Forum for "ERROR: You need to create the directory" and found that this has come up about a half dozen times this year (with one cross post in the Windows Forum), and once in January of last year. It always seems to happen with PHP5 (not PHP4) with IIS (not Apache). It also seems to happen when there is an .htaccess file in the data directory, and goes away if that file is removed or if the directory is moved into the web-accessible directory tree.

        Here are the thread numbers in which this has come up: 61796,90710,90723,94873,94886,99156

        To see a thread, type this address into your browser:

        http://moodle.org/mod/forum/discuss.php?d=

        and put the thread number immediately after the equal sign.

        RLE

        Show
        Richard L. Enison added a comment - I did a search of the Moodle Installation Problems Forum for "ERROR: You need to create the directory" and found that this has come up about a half dozen times this year (with one cross post in the Windows Forum), and once in January of last year. It always seems to happen with PHP5 (not PHP4) with IIS (not Apache). It also seems to happen when there is an .htaccess file in the data directory, and goes away if that file is removed or if the directory is moved into the web-accessible directory tree. Here are the thread numbers in which this has come up: 61796,90710,90723,94873,94886,99156 To see a thread, type this address into your browser: http://moodle.org/mod/forum/discuss.php?d= and put the thread number immediately after the equal sign. RLE
        Hide
        Richard L. Enison added a comment -

        BTW this post tells where the error msg. comes from, so you don't have to search for it:

        http://moodle.org/mod/forum/discuss.php?d=90710#p416370

        RLE

        Show
        Richard L. Enison added a comment - BTW this post tells where the error msg. comes from, so you don't have to search for it: http://moodle.org/mod/forum/discuss.php?d=90710#p416370 RLE
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d;

        4d6f6f646c6521

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; 4d6f6f646c6521
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you still believe this is an issue in supported versions, please report a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you still believe this is an issue in supported versions, please report a new issue.

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: