Gallery
From DreamHost
| This article or section may require a cleanup. We are hoping to create articles that meet certain standards. Please discuss this issue on the talk page. Editing help is available. |
Gallery is a free, robust, and popular web-based software product that lets you manage photos on a website. It uses PHP and is available as a one-click install from the the Goodies tab of your Control Panel. The latest branch is version 2 (commonly refered to as G2 or Gallery2) which boasts a database (mysql) backend and extensive code review. Gallery 2 is still in its early releases but has been very useable for some time. Planned for the next releases are performance improvements among its new features.
Contents |
Tips and Tricks
- Panel: How Do I Install Gallery 2.x at Dreamhost?
- Installing FFmpeg for movie thumbnail support
- Using the external image block feature
- Gallery Image Album Troubleshooting
Problems
Gallery on DreamHost issues
You may find that generating thumbnails/resized images will be slow or will not even complete. This is caused by locking over NFS. Gallery2 uses flock() which does not work (and is not meant) for NFS. You should switch Gallery2 to database-based file locking by going into Site Admin -> General. You will find a locking mechanism dropdown box at the bottom of the page; just change it from "File" (the default) to "Database."
You may find that large (20MB+) MOV files cannot have a thumbnail generated in Gallery2. Try moving NetPBM to the top priority of the image toolkits.
Problems with large Galleries
Large galleries with 5000+ images (espicially if being crawled by search engine spiders) may draw excessive processor power and trigger an alert with dreamhost. This can be fixed by either denying bots with a robots.txt file or asking them to delay between page loads. Not all spiders respect the robots.txt, so denying their ip's (or ranges) in the .htaccess file may be necessary.
I also found that increasing PHP's memory_limit setting from the default of 8M to 16M (or even 24M) helped a great deal with thumbnail/resized image generation. ImageMagick's convert processes were taking a long time to run, or even just timing out altogether. I'm working with large photos taken with an 8 megapixel digital camera, so they're about 3-4 MB each. I haven't yet tried with GD, but if the problem persists, that's next. Try the link below for more information:
- Can anyone veryify that changing memory_limit actually works as described here: PHP.ini
- According to support, it is not possible to change memory_limit in any of DH's shared hosting.
Common .htaccess problem with Gallery 2
For those that are having issues with Gallery breaking after setting up a .htaccess file via the Panel:
Quick info (my ticket and my solution)
I just set up a brand-new gallery2 site using the one click, got it up and running fine. As soon as I enabled the ".htaccess" for the "gallery" subdirectory, the whole site broke.. it looks like the rewrite module busted, as it is having trouble finding the image directories. Removing the htaccess setting from the panel and verifying that it was removed from the website did not help.. The website is still broken :(
I even removed the entire website + database and did a reinstall from scratch. The gallery website works just fine until you enable a password on the http://site/gallery subdirectory.. then it breaks and does not seem to repair. The html works but all the image redirections are broken.
Since other users are having this problem, I've found the solution.
Users need to make sure the "URL Rewrite" module is *deactivated* before dropping in a htaccess file.
The problem is that the dreamhost script overwrites the .htaccess file, which already contains some rewrites for the gallery application. Once those rewrites are gone, the application breaks. If the Dreamhost script could insert the htaccess password information at the top of the htaccess file, it would probably fix things.
If for some reason you can't log into your admin settings (or you dropped the .htaccess file before you turned off URL rewrite) then go to this link to directly modify your modules. (assuming you installed it to "gallery")
After you have the module deactivated and the site like you want it, go back to the modules settings and reconfigure the URL Rewrite module. Then reactivate it and all will be well
Installation: output_buffering warning
When installing you get this message:
Warning: Output buffering is enabled in your php by the output_buffering parameter(s) in php.ini. Gallery can function with this setting - downloading files is even faster - but Gallery might be unable to serve large files (e.g. large videos) and run into the memory limit. Also, some features like the progress bars might not work correctly if output buffering is enabled unless ini_set() is allowed.
To fix this, you have to configure custom php.ini file in your home directory. There is a really good guide on setting up your own php.ini at http://wiki.dreamhost.com/PHP.ini Once you go through that procedure, edit ~/[your-domain]/cgi-bin/php.ini, find the following line
output_buffering = 4096
and change it to
output_buffering = off
Refresh the install page, and the Warning is gone!
Installation: Install Other Modules
You also get the folowing warnings:
* The Dcraw module was installed, but needs configuration to be activated * The Ffmpeg module was installed, but needs configuration to be activated * The ImageMagick module was installed, but needs configuration to be activated * The Nokia Image Upload module was installed, but needs configuration to be activated * The URL Rewrite module was installed, but needs configuration to be activated
Can I Upgrade Gallery from 1.x to 2 using the DH 1 click install?
If you previously had Gallery 1.x and would like upgrade to 2 it is possible to import your old albums into the new version
- It doesn't appear that the 1 click install supports this module but installing from source works great.
- The one-click install can't be used to upgrade directly, but it can be used to install Gallery 2 separately, then you can use the import utility to import your albums from Gallery 1. You will likely be better off importing albums a few at a time, rather than importing them all at once. This is especially a good idea considering G2 is very different, and you may find you like G1 better! --Steph
Updating to other version
Sometimes when you update to Gallery 2.2 and you go to the Plugins Section in the Administration Page you only get a white page. First of all you need to activate debug mode in Gallery2. To do this you need to edit the config.php file in you gallery2 directory and write this lines:
ini_set('display_errors', 1);
$gallery->setDebug('buffered');
After, when you go to the Plugins Section you get the following warning:
Fatal error: Class 'GalleryStatus' not found in ... "module_name"
The solution (inspired by this thread) is to remove the directory of module_name located insides your_gallery/module directory. You can get multiple errors corresponding to multiple modules, all need to be removed.

