Here in Access Denied error land, I present for you a solution to one of those oh so common Drupal errors

Access denied. You are not authorized to access this page. Please log in as the admin user (the first user you created). If you cannot log in, you will have to edit settings.php to bypass this access check. To do this:

  1. With a text editor find the settings.php file on your system. From the main Drupal directory that you installed all the files into, go to sites/your_site_name if such directory exists, or else to sites/default which applies otherwise.
  2. There is a line inside your settings.php file that says $update_free_access = FALSE;. Change it to $update_free_access = TRUE;.
  3. As soon as the update.php script is done, you must change the settings.php file back to its original form with $update_free_access = FALSE;.
  4. To avoid having this problem in future, remember to log in to your website as the admin user (the user you first created) before you backup your database at the beginning of the update process.

The Fix:

Try this – go to http://yourdomainname.com/?q=user and log in. Just change the yourdomainname.com part but keep the rest of the text exactly as it is. Now go to http://yourdomainname.com/update.php

You may or may not see a few errors, just ignore them for the moment. Click the Update button.

You should now see the:

Drupal database update

The version of Drupal you are updating from has been automatically detected. You can select a different version, but you should not need to.

Click Update to start the update process…

You should now see updating your system modules (assuming that the error was caused by this in the first place – either that or you may have updated Drupal core without having logged in first).

If, like me you get a bunch of Errors like this:

warning: unlink(sites/default/files/css/css_0e2af2fb52fe6c887bc8aa7be73abcb0.css) [function.unlink]: Permission denied in W:\WWWRoot\manonmars\includes\file.inc on line 444.

You can safely ignore them.

Drupal’s Response

Updates were attempted. If you see no failures below, you may proceed happily to the administration pages. Otherwise, you may need to update your database manually. All errors have been logged.

The key word in the text above is below if you don’t see any errors, just function executes against a grey background then you’re on the right path.

Just run CRON manually and that should take care of it for you.

Simon.

2 comments

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>