Difference between revisions of "Gallery2:FAQ" - Gallery Codex
Personal tools

Difference between revisions of "Gallery2:FAQ"

From Gallery Codex

m (How can I move my gallery installation from one server to another? Script for renaming database tables)
(How to upgrade Gallery2?)
Line 35: Line 35:
===How to upgrade Gallery2?===
===How to upgrade Gallery2?===
Updating is quick and easy and should not lose any of your data. But better be safe! Make a full backup of your gallery and your g2data directories and your database. Although it is a proven concept, you better be safe than sorry.
Updating is quick and easy and should not lose any of your data. But better be safe! Make a full backup of your gallery and your g2data directories and your database. Although it is a proven concept, you better be safe than sorry. It is also important to know the current version you are running before upgrading. To figure out what version you are running do the following (once logged in as  an admin) ''Site Admin'' -> ''Maintenance'' -> ''System Information'' -> then click ''Run Now''.
'''Note! If you are upgrading a Multisite Gallery 2 install,  read [[Gallery2:Multisite#How_to_Upgrade_a_Multisite|How do I Upgrade a Multisite Gallery 2]]'''
'''Note! If you are upgrading a Multisite Gallery 2 install,  read [[Gallery2:Multisite#How_to_Upgrade_a_Multisite|How do I Upgrade a Multisite Gallery 2]]'''

Revision as of 09:45, 19 July 2006





All credits on this (beta) FAQ are due to FryFrog, text is taken from G2 FAQ thread.

Getting Gallery2

Where can I get the latest version of G2?

You can download the latest official release of G2 from the sourceforge download page. Nightly snapshots are available on galleryupdates.jpmullan.com and are reasonably stable.

How can I get Gallery2 on my webserver?

Copy the Gallery 2 files to a directory on your webserver. There are several alternatives for this step:

  • Ideally, you can use subversion to install and update your Gallery 2 installation directly on the server. But this option is only available if you have command line access to the server (ssh/telnet).
  • The next best alternative is to upload the gallery2.tar.gz or gallery2.zip archive via FTP or another method. Then unarchive / extract the archive in the command line (ssh/telnet) or with a miniature PHP script with the command tar -xzf gallery2.tar.gz for the .tar.gz archive or unzip gallery2.zip for the .zip archive. Some webhosting companies offer a control panel with a web file-browser which is capable of extracting / unarchiving archive files. It's worth a try to check if this option is available.
  • If you have neither of these options, you have to upload the complete contents of the Gallery 2 archive to the webserver with an FTP program. This will take a lot of time and is error-prone. In this case, pay special attention to the System Checks step of the installer and make sure that there are no missing or modified files.

Once I have G2, where do I begin?

The BEST place to start is /gallery2/README.html. If you wish to jump ahead and start the install, you can point your browser at /gallery2/install/ instead. If it's your first time, you will need to visit the README.html in order to find database setup instructions.

Does G2 have any special requirements?

Gallery 2 requires many of the same things that G1 required. A web server, php and some graphics manipulation programs. You probably already know these things... but there is ONE new requirement: a database. Right now, there is support for MySQL 3,4, PostgreSQL and Oracle 9/10. Of course, the other requirements are a web server (apache, iis, zeus?), php (4 or 5) and some graphics manipulation packages (netpbm, imagemagick, ffmpeg, gd). Space for the images is probably one of the more obvious requirements :)

How can I get the latest version of Gallery2?

There are two ways of keeping current, using Subversion or using nightly builds. Chetan Sarva and Jesse Mullan both offer nightly builds. The instructions for using Subversion can be found here . You can also find instructions for using TortoiseSVN here .

To get the SVN version of Gallery, see the next FAQ item.

Should I use nightly builds or Subversion?

That is up to you, I would suggest Subversion if you are comfortable working with it or don't mind learning. Once you get the original source from Subversion, updating is as simple as going to your G2 directory and typing "svn update".

Subversion uses too much disk space!

Subversion keeps a second copy of every file so commands like "svn status" and "svn diff" can run quickly, without going over the network. This does double the space required.. if you like the convenience of "svn update" but aren't doing development so you don't use status/diff much, then vote for this feature and hopefully subversion will support it someday. For now we offer a script called svnSlim.

How to upgrade Gallery2?

Updating is quick and easy and should not lose any of your data. But better be safe! Make a full backup of your gallery and your g2data directories and your database. Although it is a proven concept, you better be safe than sorry. It is also important to know the current version you are running before upgrading. To figure out what version you are running do the following (once logged in as an admin) Site Admin -> Maintenance -> System Information -> then click Run Now.

Note! If you are upgrading a Multisite Gallery 2 install, read How do I Upgrade a Multisite Gallery 2

  • 1. Get the latest code, upload it to the webserver, and unpack it over your existing copy of Gallery 2 (or use svn instead to update the code). Keep your existing config.php in place, and don't touch your (g2data) data folder or the database.
  • 2. If you use a PHP accelerator / cache (e.g. Turk mmCache, Ioncube PHPA, eaccelerator, Zend Studio, etc.), flush (clear) the cache of the accelerator. Omitting this step can sometimes lead to errors during and after the upgrade process.
  • 3. Browse to the upgrader and follow the instructions there. Make a backup of your data (g2data folder and the database) when it tells you to! Should you lose your data due to a bug in the upgrader, the first thing we're going to tell you to do is to restore from your backups! (Then we'll probably ask you to help us reproduce the bug.)
  • 4. Enjoy your new version of Gallery 2.

How do I prevent users from accessing my site during maintenance or upgrades?

Gallery 2.1+ has a "Maintenance mode" feature. Edit your config.php file using a text editor and find this section. It has instructions for turning on this mode. Example settings (use only one of these lines):

 $gallery->setConfig('mode.maintenance', true);
 $gallery->setConfig('mode.maintenance', '/maintenance.html');
 $gallery->setConfig('mode.maintenance', 'http://myothersite.com/');

Site administrators may still use the application while the site is in maintenance mode. Typical upgrade process: turn on maintenance mode, put new code in place, run through the upgrader, browse site as admin and make sure everything looks ok, activate or configure any new modules/themes/etc you wish to use, turn off maintenance mode.

Development Specific

I really wish this feature were part of G2, is it planned?

It is possible that it is planned. See this list of requested features. Also see the feature request section on sourceforge . If you don't see your idea listed you can file a feature request on sourceforge and/or start a discussion about your idea in the G2 Development forum. If you do see your idea listed it may still be a long time before it gets implemented so if you or someone you know can help out with development, please do!

I would love to write some modules, got anything useful for me?

Start with G2 Developer Starter Kit . There you will find reference to how our team works and where to find the needed documentation. First link there is the G2 Developers Guide which is a must-read before you start. Not every detail is described there yet and some stuff is outdated, but there you will get the general "feeling" on how and why our architecture is how it is. The API for all classes is self-documented with phpdoc in the code, which is extracted to the G2 API Documentation (last link in the Starter Kit). If you are on Windows and have trouble with the Makefiles to generate stuff for you, have a look at virshu 's howto Building Gallery 2 on Windows.

How can I integrate G2 into my website?

For basic integration, you can edit the theme templates to show Gallery 2 inside your own page with your header / footer / menu etc. Please see Visual Integration HowTo as well as the Theme and Template docs.

For application level integration (embedded G2) see the Integration HowTo and the Embedding & Integration Forum for existing integrations and to discuss your plans and issues.

I have some experience in linux compiling and noticed some make files and other things that would appear to need compiling... do I need to?

The Makefiles are only needed by gallery2 module developers. If you are just using G2, you don't need to "make" anything. For developers, the Makefiles automate boring tasks such as:

1) generate compiled translation files (.mo) from source language files (.po), 
2) generate database schemas from entity definitions, 
3) generate interfaces to access members of entities. 

How can I "zap" my G2 data? How do I easily clear out /g2data and the DB?

If you have manually dropped your DB or some of the files are not deletable by you (for instance, they are owned by the webserver's user) you might find Bharat's Cleanup Script useful. You can also point your browser to /gallery2/lib/support/ or /gallery2/lib/test/tools, the former is for those with any package but the dev package. The latter is part of the dev package.

Also, the G2 installer can "clean" your g2data directory. That is, it removes everything and then it adds the basic structure again, just with empty subdirectories. For this, you have to make sure there is a versions.dat file in the g2data directory and then advance to the Database Setup Step (step 5) and after hitting save, you should see the option "Erase".

General Gallery2 FAQ

Does G2 work with Safe Mode PHP?

Gallery is NOT designed to work with safe mode. You can see the sticky thread in the G2 development forum for an in depth discussion. Also see this topic for details of some experiments in getting G2 to work with safe mode. To sum it up, they are going to get G2 working first. If it works in safe mode, or can be modified easily to work in safe mode... they may. If you are trying to disable safe mode in a .htaccess file make sure you use:

php_admin_flag safe_mode off 

and NOT:

php_admin_value safe_mode off

Why can't I upload big files (over a megabyte or two)?

The upload limits are enforced by the PHP / webserver configuration and not by Gallery 2. Craig Goranson wrote a very informative email about how to fix this issue.

In short: The administrator can change the upload_max_filesize and post_max_size directives in php.ini (the PHP configuration file). Also, you can try to override the system-wide default settings in a .htaccess file. Example, add this to your .htaccess file in your gallery2/ folder to set a upload limit of 10 Mega Byte:

 php_value post_max_size 10M
 php_value upload_max_filesize 10M

This can result in a "Internal Server Error" (error status 500) on all your Gallery pages. If you get an error after this change, remove your changes. That means that your webhost doesn't allow such changes in .htaccess.

An alternative that works for some users: Add a php.ini file in your gallery2/ folder with the following contents (notice the difference, here we have a = and no php_value):

 post_max_size = 12M
 upload_max_filesize = 12M

This may or may not work. You can check if these changes have actually changed your limits by browsing to your add items -> from browser page.

If you're using Apache 2, especially with something like RedHat, you may need to edit another directive, LimitRequestBody, as described in this forum post. Setting this directive to 0 (i.e. LimitRequestBody 0) will allow you to upload as big a file as you want (until you hit upload_max_filesize and/or post_max_size -- see the above email link for more information).

PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes exhausted?

You are exhausting the available memory that PHP has access to. In php.ini there is a config variable named memory_limit that by default is set to 8MB. Edit php.ini and increase it to a larger value (restart Apache afterwards). If you don't have access to php.ini, you can add this line to your .htaccess file in your gallery2 folder. Usually, unless you are the owner of the server, you don't have access to change php.ini. If there is no .htaccess file yet, you can create one (it's just a text file with the name '.htaccess').

php_value memory_limit [new memory limit]

To change it to 24 MB, write:

php_value memory_limit 24M

If the .htaccess method does not work or if you get an internal server error after adding this line, remove the line from the .htaccess again. You can also try to change the memory_limit by adding the following line right after '<?php ' in install/index.php and in main.php:


If there's no "memory_limit" parameter in your phpinfo page, then all PHP/Webserver processes are limited by the per process max memory limit. You'll have to ask an administrator to change the limit in this case. On linux/unix, you can check the limit with the following command in the shell:

ulimit -a

Or with PHP with a script check.php

<?php print system('ulimit -a'); ?>

Does gallery remote work with G2?

It would appear it does, point gallery remote at the base url of your gallery. For instance, I would point it to "http://my.gallery.domain/gallery2/"

Can I update from G1 -> G2?

Yes. The basic strategy is that you install and configure a copy of Gallery 2 right next to your copy of Gallery 1, then you use the migration module to import all your Gallery 1 data (users, albums, photos, metadata) into your Gallery 2. This will make a complete copy of your data in Gallery 2 and then you're free to delete your Gallery 1 install. It will even give you mod_rewrite rules that can redirect all your old Gallery 1 urls to the correct places in Gallery 2. If you don't have enough free disk space to migrate it all at once, you can migrate a few albums at a time.

Please refer to this detailed guide if you have any problems: http://codex.gallery2.org/index.php/Gallery2:migration

Where can I find NetPBM, jhead or ImageMagick binaries to use with G2?

You can find links to NetPBM and jhead on the Gallery Download Page. You might also find Image Magick binaries here

Where can I find unzip / zip binaries to use with the zip cart module?

You can find them here , but keep in mind this is a 3rd party site not under Gallery's control.

I customized a *.tpl file, but then removed it... but the customization is still showing up. Did I do something wrong?

If you remove a local/*.tpl file it won't switch back to the *.tpl file due to smarty caching. You can get it to switch back to *.tpl by clearing the smarty cache manually on the filesystem, running the Flush Templates task in Site Admin/Maintenance, using Cache Maintenance found in the /lib/support/ page or by doing 'touch filename.tpl' which causes the last change time to update.

How can I move my gallery installation from one folder to another?

Here's a step by step guide:

  1. Deactivate and uninstall the url rewrite module if it's active (not just disable the rewrite rules, disable and uninstall the whole module in site admin -> modules).
  2. Move the gallery folder (move/rename it with an ftp application, a file browser or with a shell). If you choose to move gallery from a subdirectory to the root of your website, just move all files and directories that are in the gallery folder to the web root directory.
  3. Edit config.php manually. If the g2data was within the gallery directory and you moved it, update the line:
$gallery->setConfig('data.gallery.base', 'some/path'); 

If you use a multisite install, you also have to update:

$gallery->setConfig('galleryBaseUrl', );

Save config.php, and you're done.

How can I move my gallery installation from one server to another?

Here's a step by step guide:

  1. Backup your installation!
  2. Upgrade G2 on the old server to the same G2 version which you plan to install on the new server.
  3. Deactivate AND uninstall the url rewrite module if it is active, otherwise it will generate incorrect urls after your move.
  4. Backup G2 on your old host. Backup the database and the g2data folder.
  5. Copy the g2data folder and import the mysql database to your new host. You can skip copying the g2data/locks directory if you want.
  6. If you're using MySQL and moving from a windows based server to a *nix (unix, linux, ...) based server, you will have to change each database table name from lower case (e.g. g2_albumitem) to a case-sensitive name (in this example g2_AlbumItem). See script File:CaseSensitiveTables.zip to automate this process a bit.
  7. Install the gallery2 code (extract gallery2.tar.gz/zip) on the new host. It should be the same G2 version as you last used on the old host (that's why you did the upgrade in step 2.).
  8. Have your webhosting partner change the owner of the g2data dir recursively to the webserver user, unless php cgi + suexec is used. If you don't understand this instruction, forward it directly to your webhosting partner. The webhost has to do this only once, I'm sure they will do it.
  9. Don't copy the config.php from the old host to the new host unless you're willing to hand edit it. It's easier to just run the installer; browse to newhost/gallery/install/. Make sure you choose "reuse existing database tables" in the database step. Point the installer in the appropriate step to the g2data folder (which is now not empty). And finish the installer. If you choose to copy the config.php instead of running the installer you have to manually change:
    • the g2data path
    • galleryId (at the bottom of config.php)
    • db name/user if needed
  10. Go to G2 Site Admin and change all paths if needed. imagemagick, zip, netpbm, ... all modules that depend on external programs have to be tested and reconfigured. Make also sure that the mail function of G2 works on the new host.

How can I export data from one G2 to another G2 installation?

Unfortunately, there's no tool to export/import data from one G2 installation (source) to another (target). But there are a few methods that may solve your problem.

  • If there's no G2 installation yet on the target server, just copy your existing G2 installation to the target server. See the FAQ entry about moving a G2 installation from one server to another.
  • If the target G2 installation is empty or doesn't have much data yet, we'd recommend removing the target G2 installation completely, then copying the source G2 installation to the target server and then add your previous albums again, manually or with the recursive "From Local Server" method.
  • If both G2 installations are already populated with a lot of data, you can import albums/photos files only. Descriptions, keywords, user data, ... are lost, but it imports all albums with all items in the correct structure. You can also decide to only import selected albums and you can specify the target parent album: Copy the g2data/albums/ directory of the source G2 installtion to a directory somewhere on the server of the target G2 (but not into the g2data/ directory). In your target G2, go to "Site Admin" -> "General" and add the directory /path/to/source/g2data/albums/ as a local server upload path. Of course your path is different from this example path. Then go to back to the top album of your target G2 and click "add item" -> "From Local Server" and select the path you just entered in site admin. Select the albums you'd like to import and start the process. It will add all albums / photos recursively, that is, it adds them including all sub-albums etc. Once the process is finished, you can remove the /path/to/source/g2data.albums/ folder from the target server.

Why does the random image or random highlight not obey permissions? How come some of my images in private albums are shown?

Permissions are handled on an item by item bases, not an album by album basis. Just because "album01" is private, doesn't mean that "album01/album02/image3" is also private. This is by design and intentional, BUT the problem is in the interface which does not mention or explain this in any way. Someday the permissions UI will be improved.

I use NFS and Gallery isn't working, is there a solution?

By default Gallery 2 uses flock for locking and this is known not to work over NFS. Go to Site Admin / General and switch to database locking instead.

Is it my imagination, or is G2 slower than G1?

You're probably not imagining it. There are three main areas where Gallery 2 is going to be slower. Gallery 2 uses a database for its storage. This means that even the most trivial operations require communication with the database to get answers. In comparison, Gallery 1 stores everything in fairly small flat files and it loads all the data into memory and then operates on it. For small Gallery installations on hardware that is 3+ years old, you're going to find that Gallery 1 runs a fair bit faster. However, Gallery 1 will not scale as effectively so as you start to get up to having 5-10K photos, you'll find that Gallery 2 is much more efficient. Having a database also allows other applications to interact with Gallery data, which is a big advantage over Gallery 1's proprietary data format.

Gallery 2 provides complete image security. If you restrict a photo based on its permissions, no outsider can get to it. This is in contrast to Gallery 1 that merely creates urls to images that an outsider could browse to, if he or she knew the url. However, this security comes at a performance cost. We are considering different approaches, including the possibility of allowing you to lower or remove this security threshold to increase your performance.

G2 is a much larger framework than G1. It's designed to be incredibly flexible and maintainable. This leads to having a lot more code and because of the nature of PHP, this causes pages to load a little slower. However, this also means that PHP accelerators like ionCube PHPA, Turcke MMCache, eaccelerator and Pear::APC, and Zend Accelerator (commercial) can effect very substantial performance increases when properly used in conjunction with G2. We recommend this option, if it's available to you (i.e. if you have full control over the php installation on your server). eAccelerator Windows Downloads.

Performance is an important factor to us. We have introduced caches at strategic places and are working on ways to improve all of the issues above to increase performance. It is secondary to making a fully featured product for now, but as we get closer to the official release date it will gain higher priority for the development team.

Note: There's a known bug in the 2.0 release where if you import a large number of albums from Gallery 1, it can fail to optimize the permissions table leading to really bad performance (2-3+ second response times for a page load). If that happens, you can fix it. Just change any permission anywhere in your G2. You may have to do this a couple of times because each time you change a permission it has a 50% chance of re-optimizing your permission table. If you want to check the before/after, you can run this query

  select count(*) from g2_AccessMap;

Before and after the permission change. If the number of rows drops dramatically (like from 2000 rows down to 30) then you've fixed the problem.

When I upload an image, G2 doesn't seem to create sized images or thumbnails... also, when I enter an album for the first time it takes a LONG time to load. What is the deal, yo?

G2 has some fundamental differences from G1. In G1, thumbs and sized images were created at image upload. In G2, these items are not created UNTIL they are accessed/needed. This means that the first time you view a sized image or album, it may take a while for the images to be generated. Of course, subsequent visits should be much faster because they already exist. I believe there are also plans for the ability to generate the needed images at upload or when ever the user wishes, independent of viewing them for the first time. Update: There is now a check box present during import and upload that allows for the generation of thumbs/sized images right then. Using this will increase the time it takes to upload/migrate, but will take care of it immediately instead of when a user first requests the image.

I am having trouble configuring a graphics toolkit (ImageMagick, NetPBM or ffmpeg). Help?

First- when the configuration asks for the path it is not asking for the path to the gallery2 module (like gallery2/modules/imagemagick). These directories are G2's interfaces to these programs and not the programs themselves. You need to find or install the binaries on your system, make sure they are executable, and enter the appropriate path in the configuration.

Can I change the timezone for dates/times displayed in G2?

Add a line like this in config.php before the ?> at the end:


Replace PST8PDT with the appropriate timezone string. The currently isn't an option for user-selectable timezone.

Can I rename main.php?

To use a different main php file after G2 is installed follow these steps:

  • Copy or symlink main.php to the new filename.
  • Add a line like this in config.php before the ?> at the end:
define('GALLERY_MAIN_PHP', 'filename.php');

As of 2.0-rc-2 you can also do define('GALLERY_MAIN_PHP', '');

Can I install if my server only allows .php4 extension for php files?

If your system does not accept ".php" as an extension for PHP files and requires ".php4" then follow these steps:

  1. Rename index.php, main.php, install/index.php and upgrade/index.php to end in php4 extension.
  2. Browse to install/index.php4 and proceed with the install. Note the "Go to Gallery" link at the end of the install will not work.
  3. After installation follow the steps in the FAQ entry above to change main.php to main.php4.
  4. Optionally rename config.php to config.php4 and update end of bootstrap.inc to reference config.php4 (to protect config.php contents from being viewable via browser).
  5. Now you should have a functioning G2.
  6. To support upgrades, find this line in upgrade/index.php4:
 function generateUrl($uri, $print=true) {

Just after that line add:

 $uri = str_replace('index.php', 'index.php4', $uri);

And change upgrade/index.php to upgrade/index.php4 in main.php4.

Why don't you support PHP 5.0.3?

PHP 5.x versions older than 5.0.4 have a very important bug (bug id 32290). This bug affects object oriented software like G2, and the libraries that G2 uses (Smarty, ADOdb). We know of at least two features that don't work because of this bug (advanced search, publishxp). There may be many other problems, including data integrity issues.

Bottom line: PHP 5.0.3 has a grave bug. Gallery cannot reasonably work around it. Upgrading to PHP 5.0.4+ should resolve it.

If you must stick with PHP 5.0.3 you can remove the PHP version check that prevents you from installing G2 by changing a few code lines in install/steps/SystemChecksStep.class and upgrade/steps/SystemChecksStep.class. You can also fix the advanced search and publishxp, it's described in this forum topic.

How do I backup G2?

A full backup consists of your 'g2data' directory, database, /gallery/config.php and /gallery/.htacess. NOTE: If you don't use the URL Rewrite module you won't have a .htaccess file.

My Gallery URLs begin with /v/ and /d/, why?

Gallery needs these prefixes (/v/, /d/, ...) to detect different types of requests. /v/ for album and photo "view" pages, /d/ for download URLs, etc. You can change this prefix in Site Admin -> URL Rewrite. You can even remove the prefix for the view pages (/v/). However, you should be aware that if you remove the /v/ prefix, you may no longer have top level albums which have the same name as one of the directories in the Gallery directory. In other words, creating a top level album "lib", "themes", "modules", "install", .. is ok when you have a /v/ prefix, but it will result in problems when removing this prefix. There's a maintenance task to check that there's no conflict like this in your Gallery (Site Admin -> Maintenance).

How can I use Gallery 2 Images in other Websites?

You would like to show your Gallery 2 images in another website or forum (bulletin board) or you would like to add a link on another website to a specific image / album of your Gallery 2.

  • For image links, right-click with your mouse on the image in Gallery 2 and copy the image address (most browsers offer this feature)
  • For links to a specific album / item in your Gallery 2, browse to the album / item and copy the address that is in the address bar of your browser (remove the g2_GALLERYSID= stuff, if there is any)
  • If you are wondering why the links look like main.php?g2_view=core.ShowItem&g2_itemId=35 for item links and main.php?g2_view=core.DownloadItem&g2_itemId=35 for image links: These links may look a little weird, especially the DownloadItem link since you'd expect that a image URL looks rather like album/image.jpg, but it is actually a image link. If you want nicer links that look more normal, e.g. image links that end with .jpg, then actuvate the Gallery 2 URL rewrite module in site admin -> modules
  • There is a module that prepares image and item links for you such that you don't have to right-click etc. See: Preformatted URLs Module

How do I get updated items to show first in an album (like new items do)

Troubleshooting Gallery

I have a problem with something, what should I do?

To start with, updating to the latest code is a good idea. It is possible that it is already fixed. Next you should probably look around the forums to see if the problem has already been posted. Try your luck with the search function in the forums. If that doesn't help, you probably want to ask for help in the support forum. Include as much information as possible in your support request.

What information is required when I ask for help in the forums?

When you create a new topic in the support forum, please include the following information:

  • G2/system information: Copy'n'paste your G2 system information from "Site Admin -> Maintenance -> System information" (you have to click "run now" to get the system information).
  • Please add a link to your G2 install in the topic.
  • A phpinfo link is also very often needed. To create a phpinfo page on your server, do the following:
1. On your desktop, create a new text file
2. Open the text file and copy'n'paste the following:
 <?php phpinfo(); ?>
3. Save the text file and rename it to phpinfo.php (or any other file with the extension .php)
4. Upload the file to your gallery2 directory on the server
  • Make sure your file integrity is intact (see instructions)
  • A description of the problem (and the steps to reproduce if it may be a bug)
  • The relevant error message and debug output.
  • For problems in the installer the debug output should be displayed.. post the error message at the top and look for the error near the bottom of the debug output.
  • For errors while using G2 you'll need to turn on buffered debug output in config.php and then look near the bottom of the output for your error message. If you're unsure where the error message is you may post a link to the entire debug output, but please don't post the entire thing.

Getting the error message from debug output is particularly important for ERROR_STORAGE_FAILURE errors, as this is the only way to get the detailed error message from the database.

  • You can activate G2's debug mode in config.php (instructions are in config.php, you have to change the $gallery->setDebug(false); line).

The more information you provide, the more likely we can help you and the faster the issue can be resolved.

How can I make sure that my installation files are all intact?

Browse to http://www.example.com/gallery/update/index.php or http://www.example.com/gallery/install/index.php and advance to the System checks step. Make sure there are no warnings, and especially that the file integrity check passes (no missing / modified files). If there are missing / modified files, read this FAQ entry to fix it.

Thumbnails / resized images don't get generated properly, how can it be fixed?

Either you don't get any thumbnails / resized images at all or you get a "broken image" placeholder.

  • If you don't have any thumbnails / resized images at all, it means that there's probably no image toolkit module active in your G2 installation. G2 needs either the imagemagick, netpbm or GD module to be active to generate thumbnails and resized images.
    • Please read: Installing an Image Processing Library
    • Note: Imagemagick and netpbm both need an external binary application in addition to the G2 module. If the corresponding G2 module does not autodetect the path to your imagemagick / netpbm binaries, then it's most probably not available on your server. See the above link on how to get the binaries.
    • Note: GD is either available in your PHP installation or not. If it works, make sure you have a large PHP memory_limit (> 16 MB), since GD is the only image toolkit in G2 that uses the PHP memory and not system memory. You will get broken thumbnails / resized images with GD unless the PHP memory_limit is large enough.
  • If you get broken thumbnails and resized images (e.g. 92x92 pixel resizes), it means image toolkit(s) are active in G2 but they fail to generate thumbnails / resized images successfully.
    • If you're using GD, then you probably need to increase the PHP memory_limit . The best sign that the memory_limit is the problem is if you get normal thumbnails for small images but broken / no thumbnails for large images (large in dimensions / filesize).
    • Most often if that happens, one or more image toolkits don't work correctly on your system. Try installing another image tookit module for G2, another toolkit might work.
    • If you have multiple image toolkits installed, try disabling all but one of the image toolkit modules. Then add a new image to G2 to check if it works now. If not, deactive this image toolkit and activate another one. Check again, etc.
    • You can also try to just change the image site admin -> toolkit priority, which is available if more than one image toolkits are active.
    • If everything fails: For netpbm and imagemagick, you can find out why it fails by looking at the debug output. Enable buffered debug mode and add a new item to G2 and look for "executing"..."Regular output:"..."Error output:"... in the debug output.
  • Once it works again, you can generate and fix the broken thumbnails / resized images with site admin -> maintenance -> Build all thumbnails/resizes

I changed the language but nothing happens, what's wrong?

G2 depends on the system it runs on to switch to other languages than English. G2 needs php with gettext support and each language you want to switch to in G2 needs to be installed on your system. If you have command line access (ssh / telnet) to the (unix, linux) server, you can query for supported languages by `locale -a`. If only "C/POSIX" is returned, no other languages are supported and you need to reconfigure the locales and then restart apache.

Also try several variants of locales corresponding to your language. For example, fr_FR.iso885915@euro seems not to be supported by G2 while fr_FR.iso88591 works fine.

Also, there is a bug if you use Gallery2 with Drupal 4.6.x using the gallery.module module Look here for this issue (fixed in 4.7.x integration).

Why can't I install with MySQL 4.1 or higher?

If the installer gives you an error like "Client does not support authentication protocol" then the MySQL support builtin to your PHP is using an older password scheme than your MySQL database. See here for more information and a workaround to get you up and running without having to recompile or upgrade your PHP.

I get an error about "max key length" installing with MySQL?

If you see this error while installing the Core module:

Specified key was too long; max key length is 1000 bytes 

then you need to switch the database character set to something other than utf8. Currently some indexes we use exceed this default MySQL limit if the charset is utf8.

I seem to be running into some sort of MySQL query limit, is there anything that can be done?

Some hosts setup a query limit on your MySQL database. This is usually a per hour limit and would be restored in time. Floridave believes that a reasonable value for this would be 50-70k, but some hosts might set it as low as 10k. See if your host will bump it up a little bit perhaps.

I get only a blank screen when trying to view my Gallery, what's wrong?

This can have various reasons. The first thing you should check is your PHP memory limit and other PHP configuration parameters. In most cases, G2 requires a memory limit of at least 16 MB, if you are using GD, it may require even a higher limit.

When I click on item thumbnails, nothing happens, what's wrong?

Probably your PHP memory limit is too low. Increase your PHP memory limit to at least 16 MB. If the problem persists, you should activate immedate debug mode in config.php and report the problem in the forums.

Why do I see stray NetPBM and cmd.exe processes that never go away on my windows server?

If NetPBM is given a file that it can't support, it may try to put up a dialog box telling you about the error before continuing. Since your server can't display those error boxes, the rest of the image processing operations wait for you to click an "OK" button that you can't see. This may also result in G2 hanging for 30 seconds since it is waiting for the image processing to complete also. ImageMagick does not appear to have this problem.

What about the warning for missing & modified files in the installer & upgrader?

If there is a warning for missing or modified files in the installer or upgrader, you should take it seriously. Neither the install or upgrade process nor G2 as an application can work correctly with missing or modified files. Upload the modified / missing files again to your server until the warnings disappear. Possible reasons for missing / modified files:

  • Error during the FTP upload of the Gallery 2 files
  • Use of Winzip or other problematic archive programs to unarchive the Gallery 2 .zip.
  • There are reported issues for several unarchive programs on OSX

If you are a svn user, a warning for a few missing or modified files in the installer / upgrader systemcheck step is the norm. But if you experience any problems, this is surely one of the first places you should look into.

I get lots of "Warning: exec(): Unable to fork [cmd /c ...]" at the module's step in the installer for G2 (on the ImageMagick module) under Windows/IIS. Now what?

You need to give permissions for IIS to be able to read and execute the command interpreter ("cmd.exe"). Without it, Gallery won't be able to call external executables (like ImageMagick). Required steps:

1. Open a cmd-prompt with "Start", "Execute", then type "cmd.exe". Hit ENTER. 
2. At the prompt, type: 

This adds the "read" permission to the IIS-user for the cmd.exe. Close the prompt and then try activating the imagemagick module again.

I use apache's mod_layout and notice some odd error messages, what is the problem?

If you use mod_layout with Apache, make sure it is disabled for gallery files. Gallery sometimes sends binary data back from a php file, so adding a header or footer to these requests will corrupt the data! Adding the following lines to your apache config file or your .htaccess should fix it.

# Disable layout header and footer for Gallery2 
LayoutIgnoreHeaderURI /path/to/gallery2/*.* 
LayoutIgnoreFooterURI /path/to/gallery2/*.* 
# PHP Gallery2 overide Layout 
<Directory /path/to/gallery2/> 

How to set/use Gallery in debug mode?

Edit your config.php and turn on buffered debug mode like this:


Then try again. This time, you'll get quite a lot of debug output when you get the error. Look towards the bottom of the debug output and scan backwards for anything that looks like an error, then report that in the support forums. Usually that will give us enough information to work with. If you can't understand what you're seeing, err on the side of posting more info. If it's going to be more than 30-40 lines of output, you should save it into a text file and publish it on your own website and post a link to it here (so that the forum remains readable).

Where I should see dates I see "Wrong charset, cannot convert" or "Illegal character encoding" or "Illegal recode request".. what is wrong?

Some operating systems report invalid character sets to PHP leading to errors when trying to convert system-generated content (like day/month names in dates) to UTF-8. Work around this problem by placing the following in config.php:

require_once(dirname(__FILE__) . '/modules/core/classes/GalleryCapabilities.class'); 
GalleryCapabilities::set('systemCharset', 'ISO-8859-1'); 

Replace 'ISO-8859-1' with the appropriate character set for your system.

An invalid locales config normally causes uploads to fail, with the Upload Applet error message Upload error: Upload failed: ". after each uploaded item and the From Web Browser just uploads one item with the status message Successfully added 1 file.

If you are running a multi site Gallery, it might be a good idea to use an absolute path in the require_once call, like this:


I can't install G2, what should I do?

So you tried to install G2 but you get an error, probably in the install core module step. See the list of frequent installation errors.

I get a blank page / a network/webserver error, what's wrong?

If you are using PHP 5.0.3 or earlier PHP 5 versions, this is probably because of a bug. Therefore, these PHP 5 versions are not supported by G2. Either change to PHP 4.1+ or to PHP 5.0.4+.

This bug should occur in advanced search, in the publishxp module and in other places of G2.

I can't login anymore, what can I do now?

  • If you see an error message that the login information is wrong, then you used the wrong username/password to login. If you forgot your login information, use the forgot password link.
  • If you've upgraded from a version older than beta 4, please read the README.html. By clearing the cookie cache of your browser, it should be fixed.
  • If you just have changed the cookie path / domain settings in the site admin options, first delete the GALLERYSID cookie in your browser. If that doesn't fix it, or if you can login again but it shows the GALLERYSID parameter in all URLs even if you browse around in G2, you most probably entered wrong values for the cookie path/domain. If you can't login anymore, deactivate cookies in your browser and login in G2. Go to site admin and fix the cookie path/domain values.
  • If you're using a version older than RC-1 and G2 is running on a IIS webserver older than IIS-6, upgrade to G2 to RC-1 or later. We had to fix an IIS-5 bug because MS was unable to fix it in the webserver.

Progress bars don't work, what's wrong?

If you have this problem it may be difficult to tell unless you are familiar enough with G2 to know where to expect progress bars to appear. Examples are upgrader and G1 migrate.. if you don't see a progress bar at all or it just flickers quickly on the screen when the request has completed then PHP's output_buffering mode may be enabled. Check php.ini and make sure output_buffering is set to off and no output_handler is configured.

If you are running Apache it can be configured with the deflate or gzip module and this will buffer all the output also. You can check by going to http://www.whatsmyip.org/mod_gzip_test/ and putting in your gallery url and it will tell you if the deflate or gzip module is being used.

I get invalid urls with Roxen webserver, what's wrong?

You can try this patch.

I can't access G2 from my vHost or subdomain, what's wrong?

Probably you use the G2's short URLs which are generated by G2's URL rewrite module. If you have a .htaccess file in your gallery2 directory, this is the case. You have two choices:

  • Either access G2 only with one of the vHosts / (sub-)domains or
  • Don't use the URL rewrite module

And if you decide to use the URL rewrite module, you have to activate the module while accessing it from the correct / chosen vHost / (sub-)domain. To change it, access G2 from the URL which you used to install it. Deactivate and uninstall the URL rewrite module. Then access it from the URL that you prefer and install and activate the rewrite module again.

Technical background: When using the URL rewrite module, G2 has to store the path to the G2 main.php file in the database and in the .htaccess file. E.g. if the 'normal' URL is http://www.example.com/gallery/gallery2 it stores '/gallery2' in the .htaccess file and in the database. If you then want to access it from a vHost that points directly to the gallery2 directory, e.g. http://mygallery.com/, then it would generate wrong redirects and URLs since G2 still assumes it is installed in a subdirectory '/gallery2' of this domain. You may notice that this doesn't apply to two different domains which have the same webroot.

I get "Notice: Only variable references should be returned by reference in ", what's wrong?

Most probably you are running PHP 4.4.0+ and use the PHP Zend Optimizer (see phpinfo). This is a Zend Optimizer bug. See http://gallery.menalto.com/node/36605#comment-133101 for some explanations.

Solution: Use a newer Zend Optimizer version, e.g. ZendOptimizer-2.6.2 or later versions.

If you run PHP 4.4.0 but don't use the Zend Optimizer, then most probably you're using a G2 version which is older than G2 Beta 4. You should upgrade to the latest stable release of G 2.0.

If you or your host is unwilling to disable or upgrade the Zend Optimizer to a fixed version or change the PHP version, there's a workaround (solution discovered by Mark Scott, 13/10/2005, "I've found that removing optimization pass 1 removes the notices caused by optimizing away the variable that should be referenced and returned.") In php.ini replace:




You can also just suppress all PHP warnings but there's no guarantee that G2 actually works as expected:

/* in index.php, main.php and install/index.php */
error_reporting(E_ALL &~ (E_NOTICE | E_WARNING));

Related links:

MySQL "Client does not support authentication protocol" error

The reason for this is explained and several solutions are presented on this page: MySQL Reference Manual: A.2.3. Client does not support authentication protocol. Specifically, look for the instructions after:

Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. 
This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

Gallery Remote can't find my G2, what's wrong?

Possible reasons (GR = Gallery Remote, G2 = Gallery 2):

  • You need to activate the "remote" module in G2. See "Site admin" -> "Modules". If it isn't listed, download the module separately from the G2 Download Page. The module must be installed and activated
  • You used Gallery 1 before you switched to G2 and you still have the "gallery_remote2.php" file in your gallery2/ folder. Delete it.
  • You're using a proxy to connect to the internet. GR has problems with proxies.
  • Your G2 is embedded in another application and you use mode.embed.only = true in config.php. In G2.0.x, it works only mode.embed.only = false.
  • You have a very old version of GR. Download and install the latest stable release from the Gallery Download Page.
  • When you connect with your web browser to http://www.example.com/gallery2/gallery_remote2.php you get a nice-looking page that says the page is not found. See the [GR FAQ].

Publish XP shows a "web services error", what's wrong?

If this error shows up when trying to login to your G2 in the Publish XP wizard, then you probably have a problem with cookies in Internet Explorer. Delete the cookie cache in Internet Explorer and then start Publish XP again.

G2 doesn't accept the upload path that I define!

Two common "mistakes" when you don't have a dedicated -nix server.

  • If you're running G2 on a Windows machine, start the path with the drive letter (e.g. c:\ )
  • If you are on a shared host of a -nix machine, make sure that you give the full path of the directory on the server, not just the path of your share of the host. Check out this post for an example: http://gallery.menalto.com/node/37060#comment-135509

-nix server: When using a screen highlighting copy/paste action it's quite easy to inadvertently grab a preceding space (ie in front of the /home/). It can almost drive you to drink chasing apparently 'unaccepted' permissions...

Images don't show up and the album / photo links don't work, what can I do?

Possible reasons:

  • G2's URL rewrite module is active but doesn't work correctly

Fîx: browse to http://www.example.com/gallery2/main.php?g2_controller=core.AdminModules&g2_moduleId=rewrite&g2_action=deactivate (replace www.example.com/gallery2/ with the URL of your own Gallery2 installation)

If you get a Error (ERROR_PERMISSION_DENIED), then you're not logged in into your G2 and thus can't access the admin pages. In this case you have to login first and then use the above link. If the login view doesn't work, you can try to login manually with http://www.example.com/gallery/main.php?g2_view=core.UserAdmin&g2_subView=core.UserLogin&g2_controller=core.UserLogin& g2_form[formName]=UserLogin&g2_form[action][login]=Login&g2_form[username]=admin&g2_form[password]=secret (replace "secret" with your own password)

If you still get an error (ERROR_MISSING_OBJECT), go to http://www.example.com/gallery/lib/support/. Click the "Cache Maintainance" link, and clear all your db caches except for g2data/cache/derivative. Then, try the login link above, and finally, the deactivation link above that.

  • Your webserver is not properly configured and returns not the correct values for HTTP_HOST / HTTP_X_FORWARDED_SERVER

You can find out whether this is the case by looking at the http://www.example.com/gallery2/lib/support/phpinfo.php page, look for the values of HTTP_HOST and HTTP_X_FORWARDED_SERVER. If HTTP_X_FORWARDED_SERVER is missing, that's fine. If HTTP_X_FORWARDED_SERVER or HTTP_HOST have another value than the real host name (the part after http:// of your G2 URLs), then this is a problem.

If you or your admin can't change the webserver configuration (hostname in httpd.conf for HTTP_HOST for apache webservers) such that it returns a correct value, you can hack modules/core/classes/GalleryUrlGenerator.class function getCurrentDomain() to return the correct value or to ignore HTTP_X_FORWARDED_SERVER, what ever you need.

How can I change the default theme when I can't reach site admin?

If you have more than one theme active and your current default theme doesn't allow you to access site admin -> themes to change the default theme (for whatever reason), then you can try to change the theme back to matrix, the official G2 theme, with the following URL: http://www.example.com/gallery2/main.php?g2_controller=core.AdminThemes&g2_form[action][saveDefaults]=1&g2_form[default][theme]=matrix

(replace www.example.com/gallery2/ with the URL of your own Gallery2 installation)

This will only work if you are already logged in as administrator. See another FAQ entry on how to manually login if the normal login method doesn't work anymore.

install/index.php is blank or shows an error. What's wrong?

This can have several reasons.

  • If the page is blank and you're using PHP 5.0.5, then you need to change the PHP version. See PHP bug 34635
  • If you get something like "Warning: session_start():"... then your PHP is misconfigured. You probably need to set session.save_path correctly (on linux / unix "session.save_path /tmp" is a good choice). And / or you need to configure the session.save_handler correctly ("session.save_handler files" is a good choice). These settings are in php.ini of your PHP installation and you need to restart the webserver after the changes. You may be able to set the necessary PHP session variables without altering your main php.ini file by placing configuration directives in your Gallery directory's .htaccess file (Reference).
  • Else: Make sure you run PHP 4.1.0 or a newer version and make sure PHP is actually used for .php files on the webserver.

I receive a database setup error using MySQL 5.x on Windows, what can I do?

If you're using MySQL 5.x on Windows and you can't get past the Database Setup Step in the installer and get a message like

The database privileges test did not complete successfully.
Failed to create a DB test sequence.Check the returned error message and README.html for missing privileges and clean up the database.

Then you most probably have a MySQL InnoDB Engine issue. To resolve it, try: Delete BOTH your MySQL DATA and LOG files at the same time and restart the server.

  • Step 1. Stop MySQL service
  • Step 2. Delete files (your paths may be different):
C:\Program Files\MySQL\MySQL Server 5.0\data\ib_logfile*
C:\MySQL Datafiles\ibdata*
  • Step 3: Restart MySQL service

If that doesn't work for you, change your default MySQL engine from "innodb" to "myisam" in your mysql configuration. Thanks to G2 users bzink5 and tippex for the solutions. The issue is dicussed in a forum topic.

The installer does not accept my login.txt, what's wrong?

There can be several possible reasons why you may not pass the authentication step of the installer:

  • Make sure you created / uploaded the login.txt file in your Gallery 2 folder on the webserver (the parent folder of the install/ folder) and nowhere else
  • Make sure this login.txt contains just the authentication key (a 1 line string)
  • If you can pass the authentication step but loop / fall back to step 1 after advancing to step 3 or higher, then you should use a nightly snapshot / release newer than 2005/11/17 since cookieless installing was broken for a short period before this date (inproper PHP session configuration values can also lead to cookieless browsing)
  • Make sure your PHP session.save_handler is set to "files" and not to "user" (or "mm"). In development builds since 2005/11/27 or since Gallery 2.1, you shouldn't have to worry about this setting (unless PHP ini_set / ini_get are disabled in your PHP installation). You can check these PHP configuration values in a phpinfo page on your server.

Movies are not playing in my Gallery, why?

  • Problem:

When the apache2 mod_deflate module is enabled, movies most likely don't start playing in Internet Explorer (and possibly also in other browsers).

The Apache2 RemoveOutputFilter directive removes any output filter associations for files with the given extensions. This allows .htaccess files in subdirectories to undo any associations inherited from parent directories or the server config files. The extension argument is case-insensitive, and can be specified with or without a leading dot. More info on this: Apache2 documentation

  • Solution:

Put a '.htaccess' file in your g2 root directory with the following line in it:

RemoveOutputFilter wmv avi mpg mpeg
Note: if the .htaccess file already exists, add this line at the beginning
Note: add additional extensions as needed
  • Alternative problem:

Without the ffmpeg module active, movies are not playing inline, you only see a Download link.

  • Solution:

Go to "edit movie", and set movie dimensions manually. If dimensions aren't set, the embedded movie player feature will not work for this item.

  • Alternative problem:

Movie dimensions are set in Edit Movie etc but you only see the Download movie link.

  • Reason:

Your browser isn't configured to play movies embedded in the browser. You need to configure Firefox/Internet Exploret/ to play movies embedded in the browser (browser plug-ins).

I have changed the default theme and nothing works anymore. How can I switch back?

Use phpmyadmin / your mysql shell to execute the following query to change the default theme back to the matrix theme:

UPDATE g2_PluginParameterMap SET g_parameterValue = 'matrix'
WHERE g_pluginType = 'module' AND g_pluginId = 'core' AND g_parameterName = 'default.theme';

Afterwards, delete the db cache by browsing to http://example.com/gallery2/lib/support/, enter your password, click there on cache management and delete the db and template cache. Of course you need to replace example.com/gallery2/ with the actual address of your Gallery.

I get a warning for missing themes / modules in the upgrader, what should I do?

Probably you chose the wrong package for your upgrade. Only the full package has all official themes and modules. Another reason could be that you were using non-official / 3rd party modules / themes and you forgot to keep them in your modules/ or themes/ folder.

  • If the themes / modules that are missing are official ones, you can download them from the Download Page.
  • For 3rd party / non-official themes, please check the User Contributions page for the latest version of your modules / themes

If you can't get the latest version of a specific module / theme and nothing helps, the following SQL query can help you to get at least through the upgrade wizard:

delete from g2_PluginMap WHERE g_pluginId = 'PGtheme';

If a theme that is now unavailable was used as default theme or for one of your albums specifically, you will also have to update the g2_PluginParameterMap database table to change the default theme, e.g.

 UPDATE g2_PluginParameterMap SET g_parameterValue = 'matrix' where g_pluginId = 'core' and g_parameterName = 'default.theme';

And do the same for specicic albums (set the g_theme = NULL in the table g2_AlbumItem for those rows that have a theme that is no longer working in your G2.

If after removing incompatible modules you see errors when editing items in your Gallery like this:

in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 208 (gallerycoreapi::error)
in modules/core/classes/helpers/GalleryFactoryHelper_medium.class at line 59 (galleryfactoryhelper_simple::newinstance)
in modules/core/classes/GalleryCoreApi.class at line 124 (galleryfactoryhelper_medium::newinstancebyid)

, check the g2_FactoryMap table in the database for references to the removed modules.

I get Out of memory error when trying to crop a thumbnail, what should I do?

To crop the thumbnail for a very large image you may need to increase the memory limit for java. Java needs a parameter like -Xmx512M (this sets the limit to 512MB). In windows you can add this parameter in Control Panel / Java / Java tab / View.. for Java Applet Runtime Settings / Java Runtime Parameters.

I get the error 'Illegal mix of collations', what should I do?

If you get the error

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)

then you are probably using a buggy MySQL version. MySQL 4.1.16 and later as well as 5.0.17 and later have this bug fixed. Please see: http://bugs.mysql.com/bug.php?id=10446 . If you get this error during upgrade from G2.0.x or older to G2.1 or newer, please see: MySQL Upgrade Issue - UTF-8.

I enabled mod_rewrite, but it's not working, and now I can't get back to disable it - how else can I do this?

You have to modify the database manually. (You can use some web based tool do it, e.g. phpmyadmin) Login to your g2database, choose (g2_)PluginMap table. Here you have to modify the line of the rewrite module to deactivate it. To do this you can either: - manually select the line where g_pluginId is "rewrite", and turn the value of the g_active column into 0. or - run the following sql query:

UPDATE g2_PluginMap SET g_active=0 WHERE g_pluginId='rewrite';

After this, you might be ready, but you might also need to flush the cache manually. This can be done by visiting http://yourgalleryurl.com/lib/support/ and choosing the "Cache Maintenance" option. If you couldn't access this directory either, go inside your g2data/cache folder on your server, and delete everything inside it, except derivatives dir.

I get ERROR_STORAGE_FAILURE when adding new photos or creating albums, what should I do?

In a mysql database this could be a problem with the g2_SequenceId table. To fix this in phpMyAdmin, find the g2_SequenceId table and click "Browse" to see the rows. If there are multiple rows click "Delete" for each row except the one with the largest value. If there is a single row then click the "SQL" button in the very upper left.. in the popup window type:

 select max(g_id) from g2_Entity

and click Go. Find the largest id in the query results. Now go back to "Browse" for g2_SequenceId and click "Edit" for the one row there. Change the value to be one larger than the maximum id reported in the query. Note that the errors received previously may have left directories and files inside your g2data/albums directory that are not displayed by Gallery. To complete the cleanup from this problem the items not shown when browsing the gallery as a site admin should be removed (backup first!).

I get a ERROR_PLATFORM_FAILURE, what should I do?

Most probably the filesystem permissions for your G2 storage folder (usually 'g2data') are incorrect. See: How can I fix the filesystem permissions of the Gallery storage folder?.

How can I fix the filesystem permissions of the Gallery storage folder?

Usually you get either an ERROR_PLATFORM_FAILURE or the upgrade wizard reports that the filesystem permissions are wrong for your storage folder, i.e. it can't write to all files and subfolders in that folder anymore.

To fix the problem, you can try the Fix the storage folder (make it writeable) tool in http://example.com/gallery2/lib/support/ on the Filesystem Permissions page. (This tool was added in G2.1.1), older versions don't have it.

You can also try to change the permissions to 777 (read & writeable for everyone) with your FTP program. If all fails, please ask in the forum for help such that we can verify that it is indeed a filesystem permissions problem. If it actually is one, you'll have to ask your webhost to change the filesystem permissions recursively for you (e.g. chmod -R 777 g2data).

I get an error in the installation step 8 (installing core module). What's wrong?

This can have various reasons.

  • The most common one is the following:
 Error (ERROR_BAD_PARAMETER) : something/gallery2/modules/core/classes/helpers/../../../../themes/matrix/theme.inc

If you get this error, then something went wrong when uploading Gallery to your server.

Solution: Reupload the themes/ folder completely. At least themes/matrix/ with the files themes/matrix/MANIFEST, themes/matrix/theme.inc, ... is missing. You should then get to a clean state: Delete the storage folder (g2data/) and drop the Gallery database or just its database tables. By doing that you ensure that everything is exactly how it should be before Gallery is installed. Then finally you can install Gallery by running the installation wizard again.

Why do I get a MySQL "Can't connect to local MySQL server through socket" error?

This indicates that PHP cannot communicate with your MySQL server. Check to make sure that MySQL is running, and verify that it's actually on the server where you think it is. If MySQL is running on your local system try using the IP address for your host (which should be instead of "localhost" for your database and see if that fixes the problem. For other diagnostics you can try, take a look at http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html