The paths and URLs in this guide are examples. Be sure to replace them with the paths and URLs specific to your installation.
There are two different 'latest' versions of Gallery. There is the version that has been released by the Gallery developers in a packaged format on the downloads page, and there is the source code which is available from Subversion on SourceForge. Since developers are continuously adding new features and tweaking the codebase, the Gallery packages will tend to be more stable than the version you'll get from SVN. However, the version in SVN will have more current bugfixes and neat modifications. The version in SVN is typically pretty stable, since the developers use it to power their own personal Galleries, but it is bound to have the occasional major glitch.
To get the stable release of Gallery, visit the Gallery Download Page
To get the SVN version of Gallery, see the next FAQ item
See Gallery:Using Subversion. SVN nightly snapshots can also be downloaded from http://jems.de/archive
Running PHP as a CGI is usually done when PHP is not available on your server (but you can execute cgi-bin scripts) or when the normal PHP installation is running in safe mode. Note that in order for this to work, your server must be configured to read .htaccess files, which your host can disable!
./configure --enable-force-cgi-redirect --disable-safe-mode --with-config-file-path=/usr/local/lib/php-cgi
Then run make. The resulting binary will be called php in the sapi/cgi/ directory of the PHP source. Please submit the binary to alindeman, so he can include it on the download page. Please only submit binaries that use that exact configure line, for consistancy reasons.
RemoveHandler .php AddType application/cgi-php php Action application/cgi-php /cgi-bin/php.cgi
That should be it! Install Gallery in your php-cgi directory. Please note it is extremely difficult to provide support for this, because there are many things that can go wrong and it's hard to diagnose the problem; you're mostly on your own!
This is because your webserver doesn't allow you to use certain .htaccess overrides. The Gallery setup script tries to set some PHP settings, but this requires you to set AllowOverride Options FileInfo or disable the overrides. If you have access to your httpd.conf file, add this to it:
<Directory "/path/to/your/gallery/directory"> AllowOverride Options FileInfo </Directory>
If you don't have access to your httpd.conf, delete the .htaccess file (from the setup/ directory if the configuration wizard is throwing the error).
Alternately a php.ini file can be added to the gallery directory and the settings can be commented out in the .htaccess file and translated.
As an example, the value:
php_value post_max_size 20971520
becomes
post_max_size = 20971520
in the php.ini file.
This is a very common problem. It's usually because the image manipulation program isn't getting called correctly, and this can happen for a number of reasons. To diagnose the problem, follow these steps:
If you see any of the following messages, the solutions are listed below:
<?php echo ini_get("disable_functions"); ?>
If the output displays exec, your host has disabled a vital function to Gallery. Gallery will probably not run on your host.
This is an unfortunate situation, because Gallery cannot run in safe mode. You have three options, listed below (try them in that order).
Craig Goranson wrote a very informative email about how to fix this issue.
Gallery tries to override the upload_max_filesize and post_max_size directives in its .htaccess file. This means that changing the setting globally may still result in it being overridden at the .htaccess level, so you may want to just change the directive there instead of globally. Gallery tries to set both of the directives to about 20 megabytes, so this will only affect you if you're going to upload files over that size.
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).
The most common reason for this is that you have JavaScript disabled or limited in your browser. Make sure that JavaScript is allowed to open windows, or else you may not be able to login to Gallery.
The number two reason for this problem is that your login page has a slightly different hostname than the one you used for your gallery. You can check this by right clicking on the login page and selecting Properties to see what its URL is. The common cause for this is that you used a variation on the standard URL to get to your Gallery, and then the browser thinks that the JavaScript popup is actually on a different host and it causes a security exception when the popup tries to control the main window. For example, if you've told Gallery in the config wizard that your gallery is at http://www.example.com/photos and then you actually access the Gallery by going to http://example.com/photos (note the "www" is missing), you'll still see your Gallery, but you'll experience this problem. The solution is to pick one hostname and stick with it.
There could be a few reasons why this doesn't work. Here are some of them
If you don't have access to php.ini, add this to the .htaccess file in your gallery directory.
php_value session.save_path "c:\winnt\temp"
You've specified an incorrect path to your albums directory in the config wizard. You can fix this by re-running the Configuration Wizard and correcting the Albums URL value.
If you unzipped/untarred the Gallery script on a Mac running OS 9.2.1 or less (ie, non OS X), once its uploaded, three files need to be renamed. They are in the HTML_Wrap folder - inline_albumthumb.footer.default, inline_albumthumb.header.default, and inline_gallerythumb.frame.default. The last few characters at the end of these file names will get truncated on the Mac so Gallery won't be able to find them (there will be an error message above and below each photo). Adding the 't' at the end in FTP or Telnet will solve this. This is only a problem if its untarred/gzipped on a Mac. If they are unzipped on the server they will work fine. (Thanks James O'Donnell)
See next topic. Solution is the same.
This typically happens when your ISP makes a change in your environment (like upgrading PHP or moving things around) without telling you about it. In a nutshell, some of Gallery's files wind up being owned by the wrong user and their permissions become set such that Gallery can no longer write to them. I've never found this to be the result of a bug in Gallery. To fix this, you can change the permissions on your Gallery data files so that Apache can read the files again. This should only happen on Unix. If you have shell access, you can fix it like this:
cd /var/www/albums cd .. chmod -R 777 albums
If you don't have shell access, you can use your FTP client to recursively (every file and every directory) chmod the albums directory 777.
You are exhausting the available memory that PHP has access to. There are three work arounds:
1 - Edit the master 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).
2 - Edit .htaccess file - If you don't have access to php.ini then you can sometime edit / create a .htaccess file for your gallery directory. When adding that line to .htaccess, you must use a number, in bytes. For example, 8MB would be about 8000000 bytes. Sometimes you can't create a .htaccess file on a shared host and Apache will through an error message.
php_value memory_limit [new memory limit]
Sometimes you need to put:
<FilesMatch "\.(php|html?)$"> php_value memory_limit 20M </FilesMatch>
3 - Edit the local php.ini - If you are on a shared host then sometimes you can't edit the master php.ini file. So you can can edit when the php code is parsed. To do this edit main.php and put the following at the start of the php.
ini_set ( "memory_limit", "20M");
Please note that method 3 hasn't been approved by the developers yet. :)
This is because on some FTP clients, the default setting is to hide files that begin with a dot. The file may actually be on the server, but your FTP client isn't programmed to display it. To make these files "reappear", you must change some settings. PixelPoet has written a tutorial for WS_FTP available here: Quick Tips for Chmod with WS_FTP. If you use CuteFTP, see thread in the forums. For WS_FTP, simply type "-a" (without the quotes) in the whitebox below MkDir on the remote (right) side of the program.
You need to use WinZip twice. (WinZip is a bit weird when it comes to .tar.gz archives).
This is caused by a PHP directive called open_basedir. Basically, your host has misconfigured this directive and not added the directory where Gallery is located to the directories where PHP can access and modify files. You'll need to contact them and ask them to add the directory where your website files are located.
Gallery 1.x needs the exec() function to be enabled to execute ImageMagick or NetPBM. So its needed for any image manipulation action. As a result you can not upload any photos into Gallery 1.x. Please talk to your hoster about this.
Re-run the Gallery1:Configuration Wizard and change the flag on Step 2.
Which flag are you talking about? Why is it so difficult to write a simple answer to a real simple question? Which flag to set? Enough to set the debug level? Or do we have to enable syslog as well? After all, where do we have to expect the output?
I've set debug level to '3', paranoid mode and I can't see nothing at all. I expect output in my tmp directory but there's nothing. Do we need to restart Apache/IIS perhaps? Well, does not make a difference on my machine?
Upload a file named test.php to your NetPBM or ImageMagick directory. The contents of this file should be
<?php print getcwd(); ?>
View this file via the web (for example: http://www.example.com/gallery/netpbm/test.php). It will tell you the absolute path to specify.
mod_rewrite is not working correctly. Check to make sure mod_rewrite is installed and usable. Check to see if mod_rewrite is compiled into Apache
httpd -l
This will list the modules compiled into Apache. If mod_rewrite is not in this list, check in your httpd.conf file for a line similar to the following
LoadModule rewrite_module modules/mod_rewrite.so
If you are sure that mod_rewrite is loaded, then in your httpd.conf make sure that
AllowOverride FileInfo
is set for the directory where Gallery resides.
Otherwise you need to disable short_urls. Modify the following line in config.php:
$gallery->app->feature["rewrite"] = 1;
replace with
$gallery->app->feature["rewrite"] = 0;
These values are defaults. They take effect for new top-level albums, but do not affect already existing albums. If you want to change the value of these parameters for already existing albums, edit each album's properties. You can access album properties by logging in as admin and going into the album in question. Select "properties" from the "admin options" pulldown. Then, in the popup window you will be able to change the properties for that album.
No
If you go to http://www.example.com/gallery/setup/check_mail.php and it gives you the following errors:
"Error! sendmail_path not set"
and/or
"Error! SMTP not set"
You will have to do some changes to your php installation. If you get the "Error! sendmail_path not set" you can safely ignore it on Windows, since it disregards the sendmail_path anyway. To fix the other potential problem, locate your php.ini (probably under C:\Program Files\php or C:\windows), open it with a texteditor and find "mail function".
It should look something like this:
[mail function] ; For Win32 only. SMTP = ; For Win32 only. sendmail_from = ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path =
Change SMTP to whatever SMTP server you can use that doesn't need authentication and sendmail_from to an email address. Example:
SMTP = smtp.server.com sendmail_from = youremail@server.com
The Configuration Wizard will give you a special piece of information, and you will be required to edit the resetadmin file, add the string, save, and refresh your browser. This is a security measure to prove that you are an administrator.
Some other application has setup PHP to use a user-defined session handler. Gallery, however, doesn't run its own handler and relies on PHP to handle things. To correct for this, add this line to the end of your .htaccess file:
php_value session.save_handler "files"
This should fix it if you host allows you to edit PHP directives in .htaccess. If not, you may need to contact them to get it changed globally.
Bharat has made a simple script to chmod all the files in your albums directory 0777, so you can easily delete them with your FTP client. Download his script here: [1] ("Bharat's Cleanup Script"). Instructions are included in the top of the file.
As of Gallery 1.5, the CSS system has changed. There is a base.css which is loaded anytime. Then, there is screen.css which is loaded when you use a skin (or the default) and your gallery is not embedded in another program. Finally, there is embedded.css which loads when your gallery is embedded in another program. To change the color of your gallery, you can edit the appropriate CSS file or select a skin in the configuration wizard.
There are two ways to do this; both are shown below: The easiest way to do this is to use relative URLs in config.php. Note You will have to redo this each time you run the config wizard, since the config wizard won't accept relative urls. You need to edit config.php manually. There are two URLs in that file. Change each of them as follows:
From: http://www.example.com/gallery http://www.example.com/gallery/albums To: /gallery /gallery/albums (change these URL's to match your Gallery setup)
The second method does not require any server-side changes, as the changes you make are made on the client. This may not be the most efficent solution, especially if you have many client computers.
You need to edit a file called HOSTS on your client machine. The HOSTS file is a ip-address to domain-name mapping file. Adding a line to this file, will make your client look for a local ip instead of an external ip, even if you use a fully qualified domain name.
Add a line similar to this:
10.0.0.2 example.com www.example.com
This line will make all requests to example.com (and www.example.com) request the server at 10.0.0.2 (replace this with your server's real LAN IP address).
Depending on your client's operating system, the HOSTS file will be in a different place. Also note that on Windows clients, you will need to reboot the system for the changes to take place.
c:\windows\hosts
Note this file in called hosts.sam. It must be renamed hosts for everything to work.
c:\winnt\system32\drivers\etc\hosts
c:\windows\system32\drivers\etc\hosts
/etc/hosts
There is a script within the root of the gallery that does just that called block-random.php. So if your gallery was at http://www.example.com/gallery, the script would be http://www.example.com/gallery/block-random.php. All you have to do is include that script into your code
<iframe src="http://www.example.com/gallery/block-random.php" width="400" height="400" name="random-image"></iframe>
Or, alternatively:
<!--#include virtual="/gallery/block-random.php" -->
The iframe
method will create an iframe with a fixed width and height. The include
method avoids this. (Of course, you must have server-side includes enabled on your web server to use the include
method.)
This error may be caused by a faulty installation or upgrade, invalid permissions on a directory, or missing helper program. It indicates that you do not have the watermark feature installed or enabled properly. To fix this you should reinstall Gallery to the latest version or, if this is not an option or you would like to do without the watermark feature, simply find and comment as indicated the following lines in your /etc/gallery/config.php file.
/* *$gallery->app->watermarkDir = "/var/www/watermarks"; *$gallery->app->watermarkSizes = "0"; */
Using Gallery with PHP5 and language is turkish gives an erro like this: Fatal error: Call to undefined method AlbumDB::numAccessibleItems()
The reason is a bug in PHP5. See http://bugs.php.net/bug.php?id=35050
Solution: None for PHP5. For using Gallery in turkish, you need PHP4