April 6, 2011, 3:23 a.m.
posted by pypa
Coppermine is a photo gallery package written in PHP. It is designed to make it easy to upload and present images within web pages. Like MediaWiki and WordPress, PHP, and MySQL, Coppermine also requires that you have one of two image-processing applications installedGD or ImageMagick. (The most recent versions of PHP include GD.) Most web hosting providers will have at least one of these packages installed; many applications that have image-related features rely on these applications. If you run your own server, you'll have to install one of these applications yourself (assuming neither is already installed). You can download the Coppermine software at http://coppermine-gallery.net. You can read more about ImageMagick at http://www.imagemagick.org. If you want to install GD, its home page is http://www.boutell.com/gd/.
As with the other applications, Coppermine requires you to perform some tasks on the server. In this case, Coppermine needs permission to write to various directories in its installation. On servers running Linux or any other variety of UNIX, every application runs as a user. Usually Apache runs as the user apache or www, an account that is associated only with that server. Because the files in your account are most likely owned by you, not Apache, by default it won't have permission to write to those files. So if your application needs to save, modify, or delete files, you'll have to give Apache permission to do that. Generally, the easiest way to do this is to just give everyone write access to the file or directory. If you have a shell account, you can just do the following:
chmod 777 albums
This gives the owner, the owner's group, and everyone else access to read, write, and execute the files in the albums directory. Most FTP clients also enable you to change the permissions for files and directories. If yours doesn't, you should find a more full-featured FTP client. Coppermine needs permission to write to several directories, as shown in Figure.
12. Error messages from Coppermine.
Once I fix the file permissions, Coppermine asks for the same kinds of information that the other applications asked for. It needs to create an account for the administrator of the application, and it needs information about which database to use. Again, you can enter information supplied by your web hosting provider here or create your own database and user if you have the ability to do so. Coppermine also needs to know the path to the ImageMagick convert program. Here's where you might need help from your web hosting provider. If you don't have shell access yourself, they can probably tell you where that application is located, assuming it's installed.
Once you've filled out the form correctly, Coppermine will automatically log you in with the account you just created.
Coppermine is very powerful, but with that power comes complexity. Not only can you share your own images with Coppermine, but you can also allow users to upload images and share them with one another. For that reason, it supports user registration as well as the ability to assign users to groups, giving them access to particular albums and categories of albums. For example, you could create a group for your family members to upload pictures to a family photo album and another group for your friends in the garden club to share pictures of their rose gardens.
The first step in testing Coppermine is to upload a picture. Before you can do that, you have to create an album to put it in. When you're logged in as an administrator, Coppermine provides an administrative toolbar that enables you to do things such as create albums, manage the list of users, and configure the application. Using the administrator's albums page, you can add a new album, as shown in Figure.
13. Adding an album to Coppermine.
As you can see from the figure, I'm adding an album called "Family Photos." To add the album, all I have to do is click on the Apply Modifications button. Once that's done, I'm taken to my new, empty photo album. From there I can click on the Upload File link in the navigation area and upload a file using an HTML form. Coppermine enables you to upload multiple files at once in order to save time, but in this case I'm just uploading one file. Once the file is uploaded, I can assign it to an album and enter a title, description, and keywords for it, as shown in Figure.
14. Describing an image in Coppermine.
The image I uploaded was actually much larger than it appears in the figure. That's why you must have ImageMagick or GD installed in order to use Coppermineit uses them to resize the images you upload. On this screen, I've assigned the image to the Family Photos album and have given it a name and description as well.
Once I'm done with that, the image appears in the album I assigned it to. Once an image has been included in an album, users can view, rate, and comment on it.
Aside from creating albums and uploading photos, you might also want to modify the configuration of Coppermine so that it works the way you want it to. There are a number of options that enable you to control the degree to which users are allowed to participate on your site. For example, if you don't want the general public commenting on your photos, you can disallow user registration and bar users from submitting anonymous comments. You can also change the appearance of your site, picking any of the themes that are installed by default, and changing the name and description of your gallery. In Figure, you can see what the configuration page of the site looks like once I've switched themes and updated my gallery's name and description.
15. The Coppermine configuration page after a theme change.
If none of the themes included with Coppermine suit your tastes, you can find more themes at the Coppermine website. You can also create themes of your own, just as you can for MediaWiki or WordPress.
There's a lot more you can do with Coppermine; this was just a quick introduction to getting it installed and running. Fortunately, there's a detailed manual at the Coppermine website that you can delve into if you wind up using Coppermine on your own website.