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

  1. Install and configure PHP. If using Apache 2.x, make sure you install a compatible version of PHP. Edit PHP.INI
    1. extension_dir = "d:/php/extensions"
    2. doc_root = "d:/Program Files/Apache Group/Apache2/htdocs"
    3. safe_mode = Off
    4. session.save_path = C:/TMP
    5. magic_quotes_gpc = Off
    6. session.bug_compat_42
  2. Install and configure Apache, either 1.x or 2.x
    1. 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
    2. Edit Apache's httpd.conf:
      1. LoadModule php4_module c:/php/sapi/php4apache.dll
      2. LoadModule rewrite_module modules/mod_rewrite.so
      3. AddType application/x-httpd-php .php
      4. DirectoryIndex index.html index.html.var index.php
        Note: (Newer versions of Apache do not need the AddModule directive anymore, your milage may vary.)
      5. <Directory "D:\Program Files\Apache Group\Apache2\htdocs\gallery">
        AllowOverride Options FileInfo
        </Directory>
    3. Restart Apache, empty the docs/ directory, create an index.php with the following to check that PHP runs OK:

      <?php phpinfo(); ?>
       
    4. Aim your browser at http://localhost/
       
  3. 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
  4. Install Gallery
    1. Unpack the tarball into Apache's docs/ directory
    2. Cd to docs/gallery/, an create two empty files: .htaccess, and config.php
    3. Create an albums/ directory within Apache's docs/ . You might as well make this directory a sub-directory of gallery/
  5. Configure Gallery:
    1. http://localhost/gallery/setup/
      1. Path to NetPBM = C:/PHP/netpbm
      2. PNM to JPEG converter = ppmtojepg
      3. Album directory = d:/Program Files/Apache Group/Apache2/htdocs/gallery/albums
      4. Albums URL = http://localhost/gallery/albums
    2. 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
  6. 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