Answers.Body: <p>The error is due to an incorrect base url of your Drupal installation.</p>
  
  <p>Go to site/default and edit the file settings.php</p>
  
  <p>Search for $base_url, and set it to the correct url of your site.</p>
  
  <p>e.g. <a href="http://localhost/~YOUR-USER-NAME/SUBFOLDER-OF-YOUR-SITE" rel="noreferrer">http://localhost/~YOUR-USER-NAME/SUBFOLDER-OF-YOUR-SITE</a></p>
  
  <p>In my case, line 315 of settings.php looks like this:</p>
  
  <pre><code>$base_url = 'http://localhost/~alain/civitest';  // NO trailing slash!
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-20T01:41:48.973Z
Answers.Text: This worked for me!
Answers.UserDisplayName: Keith Webb
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-10T22:08:45.370Z
Answers.LastActivityDate: 2019-01-10T22:08:45.370Z
Answers.UserDisplayName: AlainB
Answers.Body: <p>Windows installation (XAMPP) with Drupal 7.59 and civicrm 4.7.31 <br>
  I tried first the trick of Muhammad Sadiq:<br>
  - it worked to avoid the error and to initiate the install<br>
  - but the permissions for the civicrm module were all blank (index.php?q=admin/people/permissions)<br>
  Second I tried the trick of pnbps with commenting line numbers 265th through 274th of "<a href="http://(mysite)/sites/all/modules/civicrm/install/index.php" rel="nofollow noreferrer">http://(mysite)/sites/all/modules/civicrm/install/index.php</a>"<br>
  - it worked to avoid the error and to initiate the install<br>
  - this time the default permissions for the civicrm module are ok</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-04T12:40:08.413Z
Answers.LastActivityDate: 2018-05-04T12:40:08.413Z
Answers.UserDisplayName: P. Schrey
Answers.Body: <p>I think this message is displayed because of <a href="https://github.com/civicrm/civicrm-core/pull/11113" rel="nofollow noreferrer">some code</a> that I added during the UK CiviCRM Sprint.  <a href="https://github.com/civicrm/civicrm-core/blob/a3f4e935bf754b457d8e20e80fb913b21ab5ef88/install/index.php#L260" rel="nofollow noreferrer">This code</a> automatically fills in the database details in the installer.</p>
  
  <p>As this is disclosing sensitive information it checks to see if the user has sufficient permissions to access the installer page. It will fail if your user doesn't have permission to 'administer site configuration'.  Please check that your user has the correct permissions.</p>
  
  <p>The check will also fail if Drupal isn't bootstrapped correctly.  Is Drupal installed and functioning correctly?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-23T10:58:26.833Z
Answers.Text: I have the same problem on my local machine with a fresh install of Drupal. If I then try to install CiviCRM it will give a false for the administer site configuration even though I am logged in as administrator.
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-18T23:13:03.480Z
Answers.Text: I think it is or because Drupal is not standard bootstrapped at this url (the civi install file is bootstrapping Drupal at line 1515 but maybe this is too late because the check is around line 280 or because there is a line at 1521 // Force the current user to anonymous.
          $original_user = $GLOBALS['user'];
          $GLOBALS['user'] = drupal_anonymous_user();
Answers.UserDisplayName: Hans Rossel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-30T13:44:19.450Z
Answers.LastActivityDate: 2017-12-30T13:44:19.450Z
Answers.UserDisplayName: William Mortada
Answers.Body: <p>on investigate the root cause of problem to identify the reason for condition "!user_access('administer site configuration')" getting true; it is, while checking for the user roles in "user.module", the global variable $user is assigned with values corresponding to anonymous user and that make the condition to true and returns the error message and exits.</p>
  
  <p>May be we need to investigate further in "session.inc" to clearly identify root cause of the problem to find a straight forward solution for this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-16T15:58:30.653Z
Answers.Text: I faced the same problem. The CiviCRM-installation were impossible for the last two versions (4.7.28 and 4.7.29).
  The drupal-installation seems to be allright and the user I am logged in with is the first and only drupal-user with full admin-permissions...
Answers.UserDisplayName: Thomas
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-25T00:48:50.323Z
Answers.LastActivityDate: 2017-12-25T00:48:50.323Z
Answers.UserDisplayName: Suresh Kumar
Answers.Body: <p>I have no idea how to solve the issue but I think commenting out the security check is not a great idea :-)
  As mentioned I encounter the same issue on a clean install of Drupal 7.56 on my local machine without creating any new user. When I then install CiviCRM 4.7.29 I get the permission error.
  @WilliamMortada: happy to provide details and test if you are happy to have a look.</p>
  
  <p>My own local workaround is to install 4.7.27 and then immediately upgrade!</p>
  
  <p>Checking with Tim here at the sprint: it looks like the test for the permission does not work if you install Drupal in subfolders? We are not sure if that is the issue but it might be worth a quick look.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-06T16:46:01.440Z
Answers.LastActivityDate: 2018-02-06T16:46:01.440Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <ul>
  <li>i got the point, i also faced the same problem for 2 days and at last i figure out that the user created during installation looks like not given the administrator rights and this might be a bug may be, anyways i did by changing following permissions.</li>
  <li>Goto People->permissions</li>
  <li>Under system heading there is 'Administer site configuration' permission.</li>
  <li>Give this permission to Annonymous User and Authenticated User.</li>
  <li>save changes and you are done.</li>
  </ul>
  
  <p>Note: Revoke permission from both users after installation. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-20T07:18:26.830Z
Answers.LastActivityDate: 2018-03-20T07:18:26.830Z
Answers.UserDisplayName: Muhammad Sadiq
Answers.Body: <p>I faced this problem too and tried a lot of things to make it works, but failed.</p>
  
  <p>Finally, I opened the file "index.php" in "<a href="http://(mysite)/sites/all/modules/civicrm/install/index.php" rel="noreferrer">http://(mysite)/sites/all/modules/civicrm/install/index.php</a>". I put the comments in line number 265th through 274th like this.</p>
  
  <pre>
  /*
    // Check that user is logged in and has administrative permissions
    // This is necessary because the script exposes the database settings in the form and these could be viewed by unauthorised users
    if ((!function_exists('user_access')) || (!user_access('administer site configuration'))) {
      $errorTitle = ts("You don't have permission to access this page");
      $errorMsg = ts("The installer can only be run by a user with the permission to administer site configuration.");
      errorDisplayPage($errorTitle, $errorMsg);
      exit();
    }
  */
  </pre>
  
  <p>Yeah. IT WORKS!!!.</p>
  
  <p>Who use this way like me, DON'T for get to remove the comments after installation is completed.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-24T03:24:57.550Z
Answers.Text: Don't forget to remove the comment after installation is completed.
Answers.UserDisplayName: pnbps
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-28T20:00:56.327Z
Answers.Text: It "works" because you're disabling security checks. This seems like a Bad Idea to recommend to general users.
Answers.UserDisplayName: choster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-31T16:07:00.083Z
Answers.Text: Yes, this will work, but it would be good to understand why you are getting the error in the first place.  Was Drupal installed and functioning correctly?  Did you log in with a user that has 'administer site configuration' permissions?
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-28T02:11:09.723Z
Answers.Text: Why we are getting this error even though logged in as admin user?
Answers.UserDisplayName: Krishnadas PC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-01T16:27:36.720Z
Answers.Text: Thanks!  Your solution works!  Additional comments had all been ruled out and no explanation.  Maybe this is a bug??
Answers.UserDisplayName: user21507
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-21T16:01:16.063Z
Answers.LastActivityDate: 2017-12-30T10:11:54.637Z
Answers.LastEditDate: 2017-12-30T10:11:54.637Z
Answers.UserDisplayName: pnbps
Body: <p>I've recently set up a subdomain of mine on a VPS, installed Drupal 7.56, and managed to download the civicrm module but when I go to <a href="http://mysite.net/drupal-7.56/sites/all/modules/civicrm/install/index.php" rel="noreferrer">http://mysite.net/drupal-7.56/sites/all/modules/civicrm/install/index.php</a> </p>
  
  <p>It give me this:</p>
  
  <pre><code>You don't have permission to access this page 
  </code></pre>
  
  <p>I was logged in as the admin before I tried the install.  Not sure if this is file permissions or what.</p>
  
  <p>PHP 7.0
  Drupal 7.56
  CiviCRM 4.7.28</p>
  
  <p>Thanks in advance,
  John</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-11T04:29:09.797Z
Comments.Text: can you clarify what you did in terms of setting up a DB for civi?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-11T16:04:02.877Z
Comments.Text: I set up both a drupal db (jwf_drupaldb) and a db that I might choose to use for the civi install (jwf_cividb).  The user jwf has full access to both of these.  Of course, the drupal install populated all the drupal tables into jwf_drupaldb.  At that point I downloaded the civi module but when I went to kick off the installer, user_access('administer site configuration') evaluated false and gave the error above.
Comments.UserDisplayName: ferkenheimerschmidt
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-14T15:51:22.950Z
Comments.Text: Still really could use some advice.  I'll be glad to provide other details - just let me know.
Comments.UserDisplayName: ferkenheimerschmidt
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-19T15:06:06.600Z
Comments.Text: I have same issue with same drupal and civicrm configuration. Thank you.
Comments.UserDisplayName: Uttam Thakor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-15T09:14:26.883Z
Comments.Text: Same problem as the original poster: stock install of Drupal 7.5.x and CiviCRM 5.4, unable to access the install page. Used the comment-out security check to bypass. Later discovered that I *also* had permissions problems at /sites/default: they were set to 555, which seems like an obvious error. Implies that there's likely a permissions-level fix somewhere.
Comments.UserDisplayName: Jeff Porten
Tags: <drupal><installation>
Title: Getting permission error when installing CiviCRM under Drupal
ThreadText: # Getting permission error when installing CiviCRM under Drupal
  
  (Asked by: username_0 on 2017-12-11)
  
  I've recently set up a subdomain of mine on a VPS, installed Drupal 7.56, and managed to download the civicrm module but when I go to <http://mysite.net/drupal-7.56/sites/all/modules/civicrm/install/index.php>
  
  It give me this:
  
  ```
  You don't have permission to access this page 
  
  ```
  
  I was logged in as the admin before I tried the install. Not sure if this is file permissions or what.
  
  PHP 7.0
  Drupal 7.56
  CiviCRM 4.7.28
  
  Thanks in advance,
  John
  
  **Tags:** drupal, installation
  
  > **Comments:**
  > **username_1**: can you clarify what you did in terms of setting up a DB for civi?  
  > **username_0**: I set up both a drupal db (jwf_drupaldb) and a db that I might choose to use for the civi install (jwf_cividb).  The user jwf has full access to both of these.  Of course, the drupal install populated all the drupal tables into jwf_drupaldb.  At that point I downloaded the civi module but when I went to kick off the installer, user_access('administer site configuration') evaluated false and gave the error above.  
  > **username_0**: Still really could use some advice.  I'll be glad to provide other details - just let me know.  
  > **username_2**: I have same issue with same drupal and civicrm configuration. Thank you.  
  > **username_3**: Same problem as the original poster: stock install of Drupal 7.5.x and CiviCRM 5.4, unable to access the install page. Used the comment-out security check to bypass. Later discovered that I *also* had permissions problems at /sites/default: they were set to 555, which seems like an obvious error. Implies that there's likely a permissions-level fix somewhere.  
  
  ---
  
  ## 7 answers
  
  ### Answer by username_13 on 2017-12-21. Score: 11 | Accepted answer
  
  I faced this problem too and tried a lot of things to make it works, but failed.
  
  Finally, I opened the file "index.php" in "<http://(mysite)/sites/all/modules/civicrm/install/index.php>". I put the comments in line number 265th through 274th like this.
  
  ```
  
  /*
    // Check that user is logged in and has administrative permissions
    // This is necessary because the script exposes the database settings in the form and these could be viewed by unauthorised users
    if ((!function_exists('user_access')) || (!user_access('administer site configuration'))) {
      $errorTitle = ts("You don't have permission to access this page");
      $errorMsg = ts("The installer can only be run by a user with the permission to administer site configuration.");
      errorDisplayPage($errorTitle, $errorMsg);
      exit();
    }
  */
  
  ```
  
  Yeah. IT WORKS!!!.
  
  Who use this way like me, DON'T for get to remove the comments after installation is completed.
  
  > **Comments:**
  > **username_13**: Don't forget to remove the comment after installation is completed.  
  > **username_14**: It "works" because you're disabling security checks. This seems like a Bad Idea to recommend to general users.  
  > **username_7**: Yes, this will work, but it would be good to understand why you are getting the error in the first place.  Was Drupal installed and functioning correctly?  Did you log in with a user that has 'administer site configuration' permissions?  
  > **username_15**: Why we are getting this error even though logged in as admin user?  
  > **username_16**: Thanks!  Your solution works!  Additional comments had all been ruled out and no explanation.  Maybe this is a bug??  
  
  ---
  
  ### Answer by username_4 on 2019-01-10. Score: 7
  
  The error is due to an incorrect base url of your Drupal installation.
  
  Go to site/default and edit the file settings.php
  
  Search for $base\_url, and set it to the correct url of your site.
  
  e.g. <http://localhost/~YOUR-USER-NAME/SUBFOLDER-OF-YOUR-SITE>
  
  In my case, line 315 of settings.php looks like this:
  
  ```
  $base_url = 'http://localhost/~alain/civitest';  // NO trailing slash!
  
  ```
  
  > **Comments:**
  > **username_5**: This worked for me!  
  
  ---
  
  ### Answer by username_6 on 2018-05-04. Score: 2
  
  Windows installation (XAMPP) with Drupal 7.59 and civicrm 4.7.31   
  I tried first the trick of username_12 username_12:  
  - it worked to avoid the error and to initiate the install  
  - but the permissions for the civicrm module were all blank (index.php?q=admin/people/permissions)  
  Second I tried the trick of username_13 with commenting line numbers 265th through 274th of "<http://(mysite)/sites/all/modules/civicrm/install/index.php>"  
  - it worked to avoid the error and to initiate the install  
  - this time the default permissions for the civicrm module are ok
  
  
  ---
  
  ### Answer by username_7 on 2017-12-30. Score: 2
  
  I think this message is displayed because of [some code](https://github.com/civicrm/civicrm-core/pull/11113) that I added during the UK CiviCRM Sprint. [This code](https://github.com/civicrm/civicrm-core/blob/a3f4e935bf754b457d8e20e80fb913b21ab5ef88/install/index.php#L260) automatically fills in the database details in the installer.
  
  As this is disclosing sensitive information it checks to see if the user has sufficient permissions to access the installer page. It will fail if your user doesn't have permission to 'administer site configuration'. Please check that your user has the correct permissions.
  
  The check will also fail if Drupal isn't bootstrapped correctly. Is Drupal installed and functioning correctly?
  
  > **Comments:**
  > **username_8**: I have the same problem on my local machine with a fresh install of Drupal. If I then try to install CiviCRM it will give a false for the administer site configuration even though I am logged in as administrator.  
  > **username_9**: I think it is or because Drupal is not standard bootstrapped at this url (the civi install file is bootstrapping Drupal at line 1515 but maybe this is too late because the check is around line 280 or because there is a line at 1521 // Force the current user to anonymous.         $original_user = $GLOBALS['user'];         $GLOBALS['user'] = drupal_anonymous_user();  
  
  ---
  
  ### Answer by username_10 on 2017-12-25. Score: 2
  
  on investigate the root cause of problem to identify the reason for condition "!user\_access('administer site configuration')" getting true; it is, while checking for the user roles in "user.module", the global variable $user is assigned with values corresponding to anonymous user and that make the condition to true and returns the error message and exits.
  
  May be we need to investigate further in "session.inc" to clearly identify root cause of the problem to find a straight forward solution for this.
  
  > **Comments:**
  > **username_11**: I faced the same problem. The CiviCRM-installation were impossible for the last two versions (4.7.28 and 4.7.29). The drupal-installation seems to be allright and the user I am logged in with is the first and only drupal-user with full admin-permissions...  
  
  ---
  
  ### Answer by username_8 on 2018-02-06. Score: 1
  
  I have no idea how to solve the issue but I think commenting out the security check is not a great idea :-)
  As mentioned I encounter the same issue on a clean install of Drupal 7.56 on my local machine without creating any new user. When I then install CiviCRM 4.7.29 I get the permission error.
  @username_7: happy to provide details and test if you are happy to have a look.
  
  My own local workaround is to install 4.7.27 and then immediately upgrade!
  
  Checking with Tim here at the sprint: it looks like the test for the permission does not work if you install Drupal in subfolders? We are not sure if that is the issue but it might be worth a quick look.
  
  
  ---
  
  ### Answer by username_12 on 2018-03-20. Score: -1
  
  * i got the point, i also faced the same problem for 2 days and at last i figure out that the user created during installation looks like not given the administrator rights and this might be a bug may be, anyways i did by changing following permissions.
  * Goto People->permissions
  * Under system heading there is 'Administer site configuration' permission.
  * Give this permission to Annonymous User and Authenticated User.
  * save changes and you are done.
  
  Note: Revoke permission from both users after installation.
  
  
  ---
  
  