Google PlusFacebookTwitter

Fixing Gallery2 Login Error / Pics from Chandernagore

By on Feb 16, 2009 in Tech Takes | 0 comments

Share On GoogleShare On FacebookShare On Twitter

boat

A few days back I needed to upload a lot of photos to my Gallery2 photo gallery. No, not for the photos from Surajkund Handicrafts Fair, I’m talking of a time before that. I’m talking of my trip to Kolkata. I wanted to upload photos from Chandernagore in an album. (You can see these now, BTW.)

I had recently upgraded my Gallery2 installation directly using the auto-upgrade facility provided by my host. Post that event, this was the first time I needed to upload something. The first thing to do, of course, is to login. This is where I encountered the first signs of trouble.

You are not authorized to view this resource. You need to login.

Annoying, because the username / password were most definitely correct. (Stored in my password manager.) It was most definitely my Gallery2 install which had short circuited somewhere. I thought of re-installing, but before I did that I thought I should run a manual upgrade once to see if it solved the problem. (Maybe the auto-upgrade wasn’t ‘clean’?) I backed up my database and the ‘g2data’ folder (just copy it to another folder on your server).

First, I tried to run the upgrade process manually (without overwriting files with a fresh copy). To do this you need to go to http://www.yourgalleryinstall.com/upgrade to initialize the web-based upgrader. The upgrader will guide you through all the steps.

Fortunately, this solved my problem. It turns out that a few of the themes which I was using hadn’t been upgraded. Once that was done (automatically by the upgrader), logins worked again. This, however, broke the permalinks module on my Gallery install.

After you’re able to successfully login, post-upgrade, upgrade any other plugins from the plugin administration page (remember to update plugin repositories first). Then, re-enable the plugins URL Rewrite and Permalinks. You will need to re-edit and upload the example .htaccess files to the folders as specified by Gallery2 (modules/rewrite/data/mod_rewrite and …/mod_rewrite_no_options), but after that it should work.

Unrelated to the above, but this might be helpful for some. For those who’ve got Gallery2 installed on their server root, you need to enter the path to the example .htaccess file folder. That bit is made clear by the placeholder file itself. But for ones who’re running Gallery2 in a subdomain using a virtual DocumentRoot you need to remember that the path you enter in the .htaccess file for URL Rewrite needs to be relative to the virtual DocumentRoot.

To give you an example, on a ‘normal’ server where Gallery2 is hosted you’ll enter something like

RewriteBase /html/username/gallery2/modules/rewrite/data/mod_rewrite/gallery2/

…while if you’re using a virtual DocumentRoot, then you’ll enter the line to be edited as

RewriteBase /gallery2/modules/rewrite/data/mod_rewrite/gallery2/

Do remember to uncomment the line because in the placeholder file it it commented out.

Hope that solves some of your Gallery problems! Enjoy the photo albums on Chandernagore and Surajkund now.



Submit a Comment

Your email address will not be published. Required fields are marked *