OK, I have been having a few issues with a client's site, I am no Drupal expert thus I am here and all help is greatly appreciated :)

Its my understanding that this site (http://norrishairandbeauty.com.au) was recently moved to a different host/server.

The client supplied their login details as the master admin login could not be found, this has since been resolved and the master admin login was reset via c-panel.

After the master admin login was changed I navigated to http://norrishairandbeauty.com.au?q=user/login logged in and found "Access Denied" for admins – up, down, and all around and this is where I am stuck!

Tried quick resolution found here: http://www.drupalace.com/questions/how_to_fix_access_denied_for_admins

But no luck! It looks as though the issues are to do with a recent server move and conflicting PHP versions, not sure what the fix is!!!

Emailed Server admin as I thought the issue was conflicting PHP version with the below response:

"On further investigation, we could see the current PHp version on your server is 5.2.9. Also, the available PHP versions on your server is, 5.2.9, 5.2.17, 5.3.16, 5.3.17"

If anyone has any ideas please help as I am more than a little stuck :(

Thank you,
Kurt

Comments

John_B’s picture

You need to realise the server login and the site login are separate and unrelated. The Drupal site login is stored in the Drupal site's database. You cannot just read it by opening the database in phpmyadmin, but you can reset it.

If you know the email for the primary account you can request a new password via yoursite.com/user page. If you do not know the email, you can find it or reset it or reset the password in phpmyadmin.

Open the site's database in phpmyadmin (normally incuded with cPanel in the databases section), open the table 'users' in that databse, and find the user line where the number in the UID column is 1. This is the original admin account. The main users's email address is there as is his user name. You can edit the email or user name. You cannot directly edit the password but you can reset it there: google "Reset password phpmyadmin Drupal 6" and you will find instructions to change the password (does not work the same on Drupal 7).

If you do not know the name of the relevant database, open the file at ~/public_html/sites/default/settings.php and read the database name there.

It is always good practice to back up a database before messing with it like this.

There is a command line tool called drush (google it) which fixes these issues in seconds, but I am assuming you have not installed it.

If it is a client site, you will, with respect, save yourself money, headaches, and possible embarassment by hiring someone to help you out until you have spent some time familiarising yourself with Drupal. A lot of people, even highly skilled developers, do mess up, and create problems, not only short term, but down the line, by doing things in an un-Drupal-like way.

BTW your site is due for some security updates. Small sites do sometimes get hacked owing to not applying updates.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

KurtHenson’s picture

Thank you for your response John_B!

Sorry I will take a small step back here, when the client supplied their log in and this was used to access the dashboard initially I received access denied pages whenever I tried to navigate to any link from the admin dashboard and the admin dashboard disappears. Strange!

So I have reset the Admin Password using phpMyAdmin and when I log in and try to navigate to any link from the dashboard I get the same issue, the admin dashboard disappears and a page that says Access Denied pops up.

This is the issue that I face, are you advising that the Admin log in details are causing this issue or are you simply advising the best practice for resetting the admin password?

I have found a similar issues and resolution here http://www.drupalace.com/questions/how_to_fix_access_denied_for_admins

The above issue was the result of a PHP upgrade, so this leaves me with the question is this installation of Drupal (v6) compatible with the PHP running on the server? My server admin has advised that "On further investigation, we could see the current PHp version on your server is 5.2.9. Also, the available PHP versions on your server is, 5.2.9, 5.2.17, 5.3.16, 5.3.17"

Cheers
Kurt

John_B’s picture

This is the issue that I face, are you advising that the Admin log in details are causing this issue or are you simply advising the best practice for resetting the admin password?

Neither really. If you know the correct password and are still getting access denied there is obviously something else wrong.

Drupal 6 should work on any version of php 5.2 http://drupal.org/requirements. I would be tempted to change it to 5.2.17 but I doubt this is the issue.

Not sure what hosting you have? I never tire of repeating that if you choose to put Drupal on shared hosting, it really needs to be with a Drupal specialist (not just a hosting company who have put up a Drupal page to attract extra business!). Drupal specialists cost more but are worth it and should help with this type of issue. However, I speculate, you have not told me about the hosting.

When migrating a site it is important to follow documenation. If you did not do so, you should clear caches. Assuming you cannot access your admin pages, and you are not using drush (mentioned above) you can also empty (not drop) all cache_ tables in phpmyadmin.

If that still does not fix the site: If your user=1 exsits and you correctly log in as user=1 and still get access denied, that normally means that your session cookies which authenticate you on the site are not working properly. This can be down to a browser setting. It can also be down to a server issue. Or down to a site where the line $cookie_domain in the file ~/public_html/sites/default/settings.php

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors