Reggie Thomson’s Diary

Diary of a Digital Photographer

December 22nd, 2006

Problems with WPG2 (Gallery2 plug-in) for WordPress

I’ve now set up a gallery for me to test the WPG2 plug-in on WordPress.

I have the open_basedir problem to solve again in wp-content/plugins/wpg2/g2embed.php on line 922:


//  require_once('G2EmbedDiscoveryUtilities.class');
    require_once(ABSPATH . '/wp-content/plugins/wpg2/G2EmbedDiscoveryUtilities.class');

Also in wp-content/plugins/wpg2/g2admin.php on line 24


//  require_once('G2EmbedDiscoveryUtilities.class');
    require_once(ABSPATH . '/wp-content/plugins/wpg2/G2EmbedDiscoveryUtilities.class');

Beyond this, I am now able to install widgets on the sidebar.

However, cannot see the thumbnail image.

This is because it has the wrong domain: http://www.domain.com/gallery/ instead of http://www.reggie.net/gallery/

I made a few changes in WordPress Admin -> WPG2, but no response

I changed the cookies directory in Gallery2 Site Admin -> Admin options -> General -> Cookies to “/gallery/”

Clicking on the link gives a “404 page not found” error.

I suspect the problem is with .htaccess - it is enabled for the WordPress site, but not for the gallery. Let’s try enabling it for Gallery2.

Hmm. No further progress. I looked in all the wpg2 and wpg2widgets files for the word “domain”. It only occurs in g2admin.php as a text example on the admin page. I will have to hunt through the database.

It’s a database problem: For g2options I have s:6:"g2_url";s:30:"http://www.domain.com/gallery/";.

This gets sorted out by “WPG2″ -> “WPG2″ -> “Show/Hide Auto Configuration Form” and entering the correct URL.

Now I get a “Page not found” error, but I see that I haven’t moved my wp-gallery2.php file from the /wp-content/plugins directory to the root directory for this WordPress. The WPG2 documentation didn’t mention this, but there was a forum entry about it here.

Excellent.

Now I have to do some editing on the layout.

December 20th, 2006

Gallery2 installs and runs despite a “Fatal Error” report

Prior to installing a multi-user version of Gallery2, I ran a check to see if my webserver could cope.

From the requirements page of Gallery2, I downloaded the check program.

I got the following error:

session.save_path writable   Fatal Warning — session.save_path must be set to a valid directory and be writable by the web server user

However, I noted that the session.save_path was available, and had lots of files in it (starting “sess_”). It seems the files are owned by “apache”, and the directory has permissions “770″ (not 777).

I may have to disable cookies to see if the gallery site still operates. OK. I’ve just tried, and it still seems to work.

December 20th, 2006

Installing Gallery2 on a server

I intend offering Gallery2 to my customers on my server. However, I would like to have a single installation on the server so that I can update one location only.

From the phpinfo() report I note that I have a common directory listed under “PHP Core” -> “open_basedir” (”Local Value”).

I untar the gallery-2.1.2-full.tar.gz file in the /my_open_basedir/ directory

Then I create a symbolic link to this in the root of the target customer’s webspace.

ln /my_open_basedir/gallery2 -s

I can then access the setup for this gallery using www.mydomain.com/gallery2

I’ll have to see if this works now.

I have to put the login.txt in /my_open_basedir/gallery2

Then, I create the gallery directory on the website and CHMOD it to 777 temporarily, while I set up the Multi-site gallery.

On Gallery2.1 installer, step 3 (Installation type) I have to type in the full directory, not just “gallery”

All the other steps were straightforward.

I now have a gallery setup on the domain.

The link has to remain, because it is referenced in the HTML.

|