Gallery3:Host specific issues - Gallery Codex
Personal tools

Gallery3:Host specific issues

From Gallery Codex

Host specific issues

Apache 1.x is not supported by Gallery 3, period, end of discussion. It's also dead software, no longer supported by the Apache Foundation (the guys writing the code for Apache). However some users have had some luck in getting Gallery 3 to work in such an environment. Below is some community recommendations to help users.
See some additional discussion on the Downside of using Apache 1.x


The REST API works well for the most part under Nginx. Servers running Nginx versions prior to 0.8.32 should use Matt Bostock's patch, which fixes a bug in Nginx's handling of 201 HTTP responses:

1 & 1

Try these steps to do a fresh install (based on this post by grievousangel):
1. Upload Gallery 3 (unzipped) to 1AND1 /gallery3. (I chose /gallery3 and these steps assume it is in /gallery3.)
2. Create a new directory "var" within the above directory, and set the permissions to 777.
3. Set up a new MySQL database, making sure that you note the password for access to it. Wait until its status is "ready", and note the settings of the newly created database.
4. Edit .htaccess, adding the following line to the TOP of the file.

   AddType x-mapp-php5 .php

5. Also in .htaccess, add the following lines after the commented-out "FilesMatch" lines:

   <FilesMatch ".album.jpg">
   Order deny,allow

6. Also in .htaccess, uncomment the mod_rewrite block at the end of the file. Set the RewriteBase parameter to the directory name that you used, such as "/" or "/gallery3" (without quotes). If you're using a subdomain without a directory (e.g.,
7. Use your browser to go to This should run the Gallery 3 installer. Follow the instructions on the display.
8. Copy and paste the database settings to the Gallery 3 form that appeared and also set prefix to g3_ or whatever you like (optional). The password is required. E.g.:

   Database name           db123456789
   User                    dbo123456789
   Password                pterodactyl
   Host                    localhost:/tmp/mysql5.sock
   Table prefix (optional) [leave blank]

9. Submit that form. You should be presented with a screen headed "Your Gallery 3 install is complete!"
10. Download the file "database.php" from the directory "var", and check that the database connection details are correct. They should look something like this:

   'connection'    => array(
       'type'     => 'mysqli',
       'user'     => 'dbo123456789',
       'pass'     => 'pterodactyl',
       'host'     => 'localhost',
       'port'     => '3316' ,
       'socket'   => '/tmp/mysql5.sock',
       'database' => 'db123456789',
       'params'   => null,

You may need to edit the lines for "port" and "socket". 11. In your browser, click "Start using Gallery". Be sure to enter the drop-down menus to test Gallery 3 operation. Sometimes it will error when going into "Dashboard", for example.
11. If there are no errors, all should be OK and really for you to import images.

File system permissions

To set the directory "var" to permissions 777, you may have to use a program in the 1&1 Control Panel.

  • Under the headings "Domains & Web Space" and "Access", click on "WebspaceExplorer".
  • Then click to open your root site where Gallery 3 is, then click on Gallery 3 in the left Folders side.
  • Then select var in the right side and right-click and click "change permissions."

No resizes or thumbs

In the file "system/libraries/drivers/Image/ImageMagick.php", you may need to add the following line:


as the second line of the file.

Italian web hosting provider users suggest this change:
look for the php.ini file customization tool in control panel and select the cgi.fix_pathinfo option.


Asked to be transfered to their grid hosting package. Once that is done you will need to create a php5.ini file, put it at the root of your site and add this line to it:

    cgi.fix_pathinfo = 1

You will also need to change the database host from localhost to the long hostname which can be found in your Hosting Control Panel by selecting "MYSQL" under the Databases tab, then clicking the pencil (Edit) icon to the right of your database name.

Once you are using their grid hosting service (4GH), it will be necessary to enable the URL Rewrite rules in the .htaccess file of the base of your Gallery 3 directory by removing the comment symbols (#) from the last ten lines of the file (from "<IfModule mod_rewrite.c>" to "</IfModule>").

If you are on a GoDaddy PHP 5.3+ server you will need to override the php.ini magic_quotes_gpc setting. GoDaddy does not recognize the default settings in the .htaccess or php.ini files (as distributed in the Gallery3 download). To fix this issue rename the php.ini file to php5.ini and problems involving magic_quotes_gpc should be resolved.

Host Gator

Logging in / out issues:

Watermark issues and alerts (from Gallery) that are url-encoded [example]:

Host Papa

Inmotion Hosting

If there is an installer check error, modify the .htaccess that came with Gallery 3 by removing the line which is failing the installer check.


Follow some helpful tips from the support page: does not include mbstring in their default php install. Just ask them to install it for you.
You might have to edit database.php to read 'type' => 'mysql', from 'type' => 'mysqli'

just host

Problems with apostrophe in photo names?
We try to disable this in the .htaccess file shipped with Gallery 3 however some hosts don't allow this change but do allow php.ini files.
create a php.ini file in the root of the album folder with

    magic_quotes_gpc = Off

UnitedHositng (UK)

From user kemmish:
Open the gallery3/.htaccess file in wordpad and at the very bottom of that file it says to not use the Index.php uncomment the following lines of code.

So if you in comment the last few lines of code in that file then save and upload the file overwriting the old .htaccess file that you just modified.


  • Attempting to change permissions on an album will result in the following warning message : Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable mod_rewrite and set AllowOverride FileInfo Options to fix this. By default, AllowOverride FileInfo Options is set, however a tweak to the gallery module must be made to remove this warning: from user kingmesal.

In the modules/gallery/helpers/access.php file replace line 719:

    fwrite($fp, "Options +FollowSymLinks\n");


    fwrite($fp, "Options +SymLinksIfOwnerMatch\n");
  • For some reason or another sometimes the Organize module fails to work correctly. While I'm not sure that this is related to a specific host or not I am putting it under B.H./H.M. because that is who I am using to host my Gallery. I found a solution which you can find documented here.

In the modules/gallery/helpers/items_rest.php replace line 86:

    foreach ($item->viewable()->children() as $child) {


    foreach ($item->viewable()->children()->as_array(true) as $child) {
  • These hosts do not have ffmpeg installed on their servers due to the intensive CPU usage that it requires (see here for more on this). Here is a thread on this issue and here is a solution/hack from user nivekiam to remove the warning message on the upload form, however here is another solution with similar results:

In the modules/gallery/views/form_uploadify.html.php replace line 115:

    <? if ($suhosin_session_encrypt || !$movies_allowed): ?>


    <? if ($suhosin_session_encrypt): ?>


PowWeb does not permit running any executables that they have not installed on their servers. This includes running a static build of FFmpeg from within Gallery3 (as 3.0.5 permits by placing ffmpeg in /gallery3/bin) to extract thumbnails from videos. This is the same issue described above for BlueHost/HostMonster, and for the same reasons. As of March 1, 2013, in a Support Ticket, PowWeb said: "We are sorry to say that we do not support FFmpeg on our servers. However, we will try to support it in near future. Unfortunately, we cannot tell the exact time frame when we do support FFmpeg."