How To Install Coppermine
What is Coppermine?
Coppermine is a Photo Gallery written in PHP which will allow you to organize and present your images and photos using thumbnails. You could also use it to organize other files as well. Coppermine is a good for those who want to showcase their artwork, for photographers or others who routinely upload and update images.
- A CGI Account
- A MySQL Database
- Latest stable release of Coppermine (Version 1.4.8 was used for this tutorial.)
This tutorial might not have been written during the release of the most current version of this script, but may work with newer versions. It is the domain owner's responsibility to be sure that any script that is run on their CGI server is secure and stable. This means making sure that the script and all it's associated files are of the most recent stable and secure version available.
Remember that only your main account can access CGI scripts on your server. Any hosting or extra FTP accounts that access these scripts may cause your account to be deactivated. To reactivate your account, you'll have to contact support.
For this script to work correctly, please place it's files in a directory created in your CGI server's root directory. Do not place this script in your cgi-bin directory, if you have one.
Important Note About Uninstalling Coppermine:
Before you uninstall Coppermine, you must delete all your photos, albums and categories from within coppermine using the administration features. Otherwise you may not be able to fully remove all of Coppermine's files. After you have deleted all of Coppermine's files, there is one that you will not be able to delete:
This will mean that all the directories in that path can not be removed either. Please send an E-Mail to support asking for this file and it's all the directories in it's path (albums, userpics, dummy) to be removed along with your old coppermine directory. We will have to remove it for you.
Download and extract the files from the archive onto your hard drive.
If you are installing version 1.4.8 or newer, you need to make changes to one of the files. Open the
/includes/init.inc.phpfile in a text editor. Find this text: Include config and functions files. Now change these two lines below it:
ob_start();should be changed to
ob_clean();should be changed to
Save the file when done. Note you must do this before you upload it to your CGI server.
Log into your to your CGI server using your FTP program. This would be cgi.yourdomain.com where yourdomain.com represents your actual domain name.
Create a new directory on your CGI server named coppermine or whatever you wish to have as a directory name. When visitors go to the site they will be going to http://cgi.yourdomain.com/coppermine/ for example.
Upload all files and folders that you extracted from the Coppermine archive on your hard drive to your new directory on your CGI server.
Change the file permissions for the following directories to 777:
Point your browser to http://cgi.yourdomain.com/coppermine/install.php where yourdomain.com represents your actual domain name and coppermine represents the folder you uploaded the Coppermine files to.
Enter the following information:
Username: Pick a username here. Password: Type in a password. Please write down your username and password somewhere so you remember them. MySQL Host: localhost MySQL Database Name: yourdomaincom (Replace with your actual domain name without the dot. MySQL Username: This is exactly the same thing you typed for MySQL Database Name above. MySQL Password: Your database password (which is different from your CGI server password). MySQL table prefix: It is a good idea to leave this as is. ImageMagick path: Leave blank. While we do have ImageMagick for php installed, it's not executable by the Coppermine Script at this time. As a result, GD is used for creating thumbnails.
Click the Let's Go! button when done. Then the Let's Continue! button on the next page.
Post Configuration:Note that if you are using a version of Coppermine prior to 1.4.8, then the following must be completed before you upload any images!
Move to the include directory and download the config.inc.php file.
Open the downloaded config.inc.php file in a text editor. Make sure that the line below shows up right after the
<?phpline. If it does not, insert it:
Save the file when done.
Delete the old
/include/config.inc.phpfile from your server (it's important that you do this first). Upload the new config.inc.php file to the include directory in the coppermine directory on your CGI server.
After following the above instructions, you should now be at the Coppermine Administration page. If you are not, then point your browser to http://cgi.yourdomain.com/coppermine/ where yourdomain.com should be your domain name and coppermine where you installed the Coppermine files to. Click on the login in the upper right of the page. Type in your username and password you created during installation. Click Continue.
You'll see a row of buttons on the top of the page. Click on the Config button. Look at the different options and see if there are any you wish to change. If you can not see anything but a list of titles, click on the arrow next to the title you want to look at, or click the Expand All link button in the upper left.
Because zip files are not allowed on the CGI server, you need to set Allow ZIP-download of favorites to no.
Files and thumbnails advanced settings:
Allowed audio types should be blank. Delete anything in this box. Allowed document types are only what we allow on the CGI server. Please see File Types Allowed On The CGI Server for more information.
Click Save New Configuration at the bottom of the page when done.
Disallow Visitor Uploads:
You need to click on the Groups button and set it so that visitors can not upload photos. In the Public album uploads and Personal gallery columsn, be sure that all instances of Allowed is set to No. Click Apply Modifications when done. The page will still reappear but you may now go on to other sections of Coppermine as your changes have been made. You need to make these changes so that your domain doesn't get taken offline in case someone uploads an undesireable image or file. Furthermore, allowing user uploads can be considered a form of "hosting" which is not allowed on your CGI server.
Files and thumbnails advanced settings:
Whether you are rebuilding your installation or starting a new one, be sure that "Method for resizing images" is set to "GD Version 2.x" from the drop down box. That is the version of GD we use on the server.
Adding and Managing Images:
Click this button to add new categories within albums. You should create at least one category, though it is not required. Categories are where your albums will be placed. Type in a category title and description, then click on the Update/Create category button. Click on the Album List link at the top right (or left menu, depending on your template) to see your category listed.
You should create at least one album. Click the Albums button to create new albums.
Select a category from the drop-down box. If you created one in Step 1 above, select that one and this album will appear in that category. Otherwise, at least select the one labled *My gallery*.
Click the New link on the button below the larger box.
Be sure that new album is selected in the larger box. You'll see in the smaller box below the larger one the words new album. Erase those characters in that box and type in a new album name.
Click Apply modifications when done. Click the Continue button on the next page.
Click on the link to the category where you placed your album to see your album listed.
If you click on the Properties link next to the album, you can set different properties for your album. Note that you can not give the album a thumbnail until after you upload an image to the album. Then revisit the Album list link in the upper right of the page and click on Properties again to set the image.
Always be sure that Visitors can upload files is set to no to comply with CGI server rules, especially if you weren't able to do this in the Groups configuration. If you did set it in the Groups configuration, it should be automatically set to no for you.
Click on Update album when done. You may be returned to the edit page. You can now go on to the next step and upload files to the album.
NOTE: If you create another album with the same name as one that is already created, it will be ignored and any new images you add to that album will appear in that same album along with any previous images you've added to that particular album.
While it's possible to upload files in Coppermine, it's best to use your FTP progam to upload your images instead. This is a faster, safer way.
Gather all your photos in a directory on your hard drive. Name the directory the same as you did your new album where the pictures will be placed. Add your photos to your directory. You will not need to make any thumbnail images as Coppermine will do that for you after you upload the images and import them. Be sure your images are JPG, GIF or PNG. You can not have any other image formats on the CGI server.
A note about file and image sizes:
It's best to keep your image sizes at a reasonable level. For normal photo album use, pictures should be no more than 640 x 480. If you are supplying photos and images people can use for desktop wallpaper, please keep those under 1280 x 968. Try to keep the file size under 500K as well, if possible.
Log into you CGI server and upload your new directory and images into Coppermine's
Set the file permissions to the new directory to 777.
Point your browser to your Coppermine gallery and log in.
Click on the Batch Add Files link in the menu at the top.
Click on the name of the directory you just added in step 2 above.
Click on OK next to the directory path.
In the upper right drop down box, select the album you created above for these photos.
All the images should be checked by default, with a thumbnail of each one on the right side. Uncheck any of those you do not want placed in this album. Note that this feature is nice if you decide to add photos to this same album in the feature. If this is the case, double-click on the top or bottom box in the row of boxes next to the filenames to clear those checkmarks, and then check only the photos you want to add to the album.
Click the Insert selected files button when done.
It may take a little while for your photos to load but look on the far right Result column. If there's a circle that says OK then your photos were added successfully. If not, look at the bottom of the page for explainations on how to fix the problem.
Next click on the Album properties link at the bottom of the page. From here you can also rename your album (note that this does not rename the folder on your CGI server). Be sure that Visitors can upload files? is set to no. When done filling in all the information you want to, click on the Update album button. You will see the album properties page again. You're now ready to edit each picture's information.
Click on the Edit files link in the top left of the album properties page.
Use these forms to add titles, descriptions keywords (separated by a space, not a comma), etc. for each picture. If you have more pictures than will fit on the page, you'll be prompted to fill in more when you click the Apply modifications button at the bottom. Do this when you're done entering the information on the current page of images. You will be taken to the same page again but your changes will be made to the gallery. You can now click the Home button in the gallery menu and navigate to your new album to see your images.
I get a database error when I try to run the script.
Be sure that you have set up the configuration properly. For more information, please see I get a database error when I try to run a script that accesses the MySQL database.
After uploading images, I get an error box at the bottom referencing boxes I didn't add upload images to.
This is because you added less files than there were boxes for them on the Upload page. You could set the number of files in the Groups button and changing the setting in the column labeled Maximum/exact number of file upload boxes. Try setting it to 1.
I get errors after adding my title and description to an image and no images are added.
Be sure you have edited the include/config.inc.php file in Coppermine according to the post-configuration instructions above. Also be sure that your albums, albums/userpics and albums/edit directory permissions are all set to 777.
My thumbnails look awful and/or are the wrong color or size.
Please note the configuration section and be sure that the GD Version is set to 2.x. This is found under Files and thumbnails advanced settings / Method for resizing images area. If that does not work, you could try the following steps to rebuild your thumbnails:
Be sure your FTP folders are set to proper permissions.
- Log into your CGI FTP and then move to the coppermine directory.
- Move to your 'albums' directory.
- Select all the directories and then right click, and choose to change permissions.
- Check "write" in all boxes or fill in 777 in a numerical box.
- Execute this by clicking OK.
- Log off your FTP site.
In your web browser, go to your Coppermine site and log so you can administer your site.
From the menu at the top (the one with the buttons), click on the "Admin Tools" button.
There are several boxes with title bars on them. Look for one that says "Update Thumbs and/or Resized Photos". There will be a radio button next to that text. Click in that radio button to select it.
In that box find "Both thumbnails and resized pics" and click on the radio button next to that text to select it. Leave the # of thumbs to update at once to 45. You will probably either be asked again to do more or have to repeat this process as many times as it takes to regenerate all your albums.
Scroll down to the very bottom of the page to an area that says "Select Albums". From the drop down, select 'All Albums' (or if you have a lot of pictures, do one album at a time. Click the Submit Button.
If you are doing more than one album or a lot of pictures, you may have to go and repeat this process for each album until done.
If you have any problems or questions about Coppermine, please see the Coppermine Web Site.
Active Web Hosting may not be able to provide support for this program or it's installation.
Below you'll find a list of alternative software that you may also want to try. Click on the program name to go to the author's site. Click on the 'Tutorial' link to view our installation tutorial.