Answers.Body: <p>In windows to change the folder permissions use <code>attrib -r path\to\sites\default</code> (can be a relative or absolute path).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-05T14:23:14.570Z
Answers.LastActivityDate: 2020-11-05T14:23:14.570Z
Answers.UserDisplayName: Demerit
Body: <p>I have just tried installing CiviCRM 5.30.1 using Drupal 7 under WIMP, i.e. Windows, IIS, MySQL and PHP 7.4, and was unable to do so, as I got a message telling me that \sites\default was not writable.  On investigation, it seems that the PHP function is_writable will <em>always</em> return false under Windows. This means that it seems you can't install CiviCRM under Windows any more, as the IsCreatable function in \sites\all\modules\civicrm\setup\src\Setup\FileUtil.php relies on the is_writable function to test if the above folder is writable during the setup process.  I got round it with the following code snippet.</p>
  <pre><code>public static function isCreateable($file) {
      if (file_exists($file)) {
        return is_writable($file);
      }
  
      $next = dirname($file);
      do {
        $current = $next;
          // Under Windows, it seems that folder are never writable      if (file_exists($current)) {
          if( is_writable($current)) {
            return true;
          } else {
            //Try to create a file
              $result = fopen(&quot;Test.tmp&quot;, &quot;w&quot;);
              if ($result) {
              // Close the file.
              fclose($result);
              // Delete it.
              unlink(&quot;Test.tmp&quot;);
              return true;
              } else {
                return false;
              }
          }
        $next = dirname($current);
      } while ($current &amp;&amp; $next &amp;&amp; $current != $next);
  
      return FALSE;
    }
  </code></pre>
  <p>No doubt some of you CiviCRM experts will have a comment.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-04T12:25:16.623Z
Comments.Text: I install on windows often. Use `attrib -r sites/default`.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-04T21:52:57.800Z
Comments.Text: Typo: I meant `attrib -r sites\default`, with a backslash.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-05T14:13:23.767Z
Comments.Text: It is so long since I used DOS type commands - good thinking, that solved the problem!
Comments.UserDisplayName: Stephen Palmstrom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-05T14:22:04.453Z
Comments.Text: ok cool will post as answer
Comments.UserDisplayName: Demerit
Tags: <installation><windows>
Title: Problems installing CiviCRM under Drupal 7 on Windows?
ThreadText: # Problems installing CiviCRM under Drupal 7 on Windows?
  
  (Asked by: username_0 on 2020-11-04)
  
  I have just tried installing CiviCRM 5.30.1 using Drupal 7 under WIMP, i.e. Windows, IIS, MySQL and PHP 7.4, and was unable to do so, as I got a message telling me that \sites\default was not writable.  On investigation, it seems that the PHP function is_writable will always return false under Windows. This means that it seems you can't install CiviCRM under Windows any more, as the IsCreatable function in \sites\all\modules\civicrm\setup\src\Setup\FileUtil.php relies on the is_writable function to test if the above folder is writable during the setup process.  I got round it with the following code snippet.
  public static function isCreateable($file) {
      if (file_exists($file)) {
        return is_writable($file);
      }
  
      $next = dirname($file);
      do {
        $current = $next;
          // Under Windows, it seems that folder are never writable      if (file_exists($current)) {
          if( is_writable($current)) {
            return true;
          } else {
            //Try to create a file
              $result = fopen("Test.tmp", "w");
              if ($result) {
              // Close the file.
              fclose($result);
              // Delete it.
              unlink("Test.tmp");
              return true;
              } else {
                return false;
              }
          }
        $next = dirname($current);
      } while ($current && $next && $current != $next);
  
      return FALSE;
    }
  
  No doubt some of you CiviCRM experts will have a comment.
  
  **Tags:** installation, windows
  
  > **Comments:**
  > **username_1**: I install on windows often. Use `attrib -r sites/default`.  
  > **username_1**: Typo: I meant `attrib -r sites\default`, with a backslash.  
  > **username_0**: It is so long since I used DOS type commands - good thinking, that solved the problem!  
  > **username_1**: ok cool will post as answer  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-05. Score: 1
  
  In windows to change the folder permissions use `attrib -r path\to\sites\default` (can be a relative or absolute path).
  
  
  ---
  
  