Web-based picture gallery with Gallery
Introduction
Gallery is an open-source, PHP-based
tool to manage web-based galleries. A gallery is a set of albums, each album
consisting on a set of pictures.
Setup
- Install and configure PHP. If using Apache 2.x, make sure you
install a compatible version of PHP. Edit PHP.INI
- extension_dir = "d:/php/extensions"
- doc_root = "d:/Program Files/Apache Group/Apache2/htdocs"
- safe_mode = Off
- session.save_path = C:/TMP
- magic_quotes_gpc = Off
- session.bug_compat_42
- Install and configure Apache, either 1.x or 2.x
- Move php4ts.dll into the directory where php4apache.dll (php4apache2.dll
for Apache 2.x) lives, eg. C:\php\sapi\ because php4apache.dll depends
on php4ts.dll to work
- Edit Apache's httpd.conf:
- LoadModule php4_module c:/php/sapi/php4apache.dll
- LoadModule rewrite_module modules/mod_rewrite.so
- AddType application/x-httpd-php .php
- DirectoryIndex index.html index.html.var index.php
Note:
(Newer versions of Apache do not need the AddModule directive anymore,
your milage may vary.)
- <Directory "D:\Program Files\Apache Group\Apache2\htdocs\gallery">
AllowOverride
Options FileInfo
</Directory>
- Restart Apache, empty the docs/ directory, create an index.php with
the following to check that PHP runs OK:
<?php phpinfo();
?>
- Aim your browser at http://localhost/
- Install the NetPBM module on which Gallery depends for image
manipulation. You can install it anywhere, eg. under C:\PHP\, and then add
this location into Windows' PATH system environment variable. If this item
does not appear when running the "echo %PATH%" DOS command, reboot
Windows for this changed to occur
- Install Gallery
- Unpack the tarball into Apache's docs/ directory
- Cd to docs/gallery/, an create two empty files: .htaccess, and config.php
- Create an albums/ directory within Apache's docs/ . You might as
well make this directory a sub-directory of gallery/
- Configure Gallery:
- http://localhost/gallery/setup/
- Path to NetPBM = C:/PHP/netpbm
- PNM to JPEG converter = ppmtojepg
- Album directory = d:/Program Files/Apache Group/Apache2/htdocs/gallery/albums
- Albums URL = http://localhost/gallery/albums
- If you're on Windows, you cannot chmod files. Instead, run
the secure.bat file, located in your gallery directory. This will tighten
up security, and disallow the usage of the configuration wizard. If
you want to redo any configuration tasks, run configure.bat from the
same directory, do your changes and run secure.bat again
- Check that Gallery works by aiming at http://localhost/gallery
Using Gallery Remote
http://gallery.menalto.com/modules.php?op=modload&name=GalleryDocs&file=index&page=gallery-remote.php
Adding Gallery to Nuke or Post-Nuke
Gallery is compatible with Nuke 5.0+ and Post-Nuke as an add-on module. Simply
put your gallery directory inside the Nuke modules directory and you're all
set. All the regular Gallery features will work properly while embedded inside
Nuke, and Gallery will have the same look and feel as the rest of your Nuke
site.
Q&A
"Success I can read your .htaccess file" BUT "Warning! Either
mod_rewrite is not installed or your .htaccess file is not enabled (see above).
Either way, we'll have to use longer URLs in the Gallery. If you
want to turn it on I'd suggest that you make sure that your .htaccess file works
and then if it still doesn't work you may need to reconfigure and rebuild Apache
with this flag: --enable-module=rewrite" ALTHOUGH LoadModule rewrite_module
modules/mod_rewrite.so
In the "Thumbnail image" part of the configuation, slashes are
mixed / and \ : Is this an issue?
When giving the URL to a directory that contains pictures, make sure the
URL ends with a slash...
Resources