Gallery2:Installation Requirements - Gallery Codex
Personal tools

Gallery2:Installation Requirements

From Gallery Codex

Revision as of 08:40, 7 August 2005 by Bharat (Talk | contribs) (mod_rewrite)

Gallery has certain technical requirements that must be met (i.e. installed and/or configured) on your server before you attempt to install it.

Web Server


Apache (Apache 1, Apache 2) is the most popular web server in the world, and is the one recommended by the Gallery Team for use with Gallery 2. It can be downloaded from the Apache HTTPD Project's site


Microsoft's IIS (Internet Information Services) web server has also been known to work. Short URLs / G1 redirects (URL rewrite module) are not yet supported for IIS.

Zeus, ...

There are a lot of alternative web servers. G2 should work on any web server that can run PHP. But short URLs / G1 redirects (URL rewrite module) probably do not work with all of them.


Gallery is written in PHP (recursive acronym for PHP: Hypertext Processor). It is one of the most popular, free web-based languages in the world today. It can also be downloaded gratis from the PHP Project's site.

Gallery requires at least version 4.x (4.1.0 or more recent) or 5.x (5.0.4 or more recent) to function properly.

PHP Settings

In addition to a basic PHP installation, Gallery requires certain PHP settings to be setup correctly in order to function optimally

PHP settings can be changed in php.ini, as described in the PHP documentation

  • safe_mode safe_mode must be disabled in order for Gallery to work correctly
  • disable_functions The disable_functions directive must not include the functions exec and set_time_limit
  • file_uploads file_uploads must be set to On if Gallery is to be able to upload files from your computer

alindeman has created a script to check your Gallery for potential problems due to PHP settings. Once you have downloaded Gallery, you can run the script in If any tests fail, you may need to adjust your settings before trying to install Gallery.


Gallery 2 requires one of the following database management systems (DBMS): MySQL 3.x or 4.x, PostgreSQL 7.x, Oracle 9i or 10g

Image Processing Library

Gallery 2 requires either NetPBM 9.x or newer, ImageMagick 5.x or newer, GD 2.x or newer, or GraphicsMagick 1.x or newer in order to opera (e.g. generate thumbnails) on your images and photographs.

More information on how to install an image processing library is explained on Installing an Image Processing Library

Optional Items


mod_rewrite is an Apache server extension that enables your Gallery 2 to use "short URLs." That is, instead of

the URL would be reduced to

Gallery 2 will attempt to automatically check for the presence of mod_rewrite during the installation process if you select the URL rewrite module.


If the Ffmpeg module is activated, it will automatically create thumbnails for movies. The ffmpeg module requires the ffmpeg binary.


Dcraw is a graphics toolkit that can be used to process RAW images produced by high end digital cameras. You must install the dcraw binary to activate the dcraw module in G2.


jhead is a free tool that can be used to extract EXIF data from images, which most digital cameras now add to photos. If enabled, EXIF data will be preserved when operating with the netpbm toolkit on your original photos in G2. You don't need jhead for the EXIF features in G2, a libarary written in PHP is used to extract the EXIF data from images. Imagemagick and GD don't need jhead to preserve the exif data when manipulating images.


infozip is a free tool that allows Gallery to unzip ZIP archives so that you can easily upload multiple photos. If enabled, you will be able to upload a ZIP archive as you would any other single picture, and Gallery will add all the images in the archive.

zip / unzip

zip is required for the zip download module and unzip for the archive upload module. Most linux / unix based platforms already have these binaries. For MS Windows, the zip.exe / unzip.exe binaries from cygwin are also an alternative.