Installing Gallery 2 with the preinstaller on your webserver is as simple as:
- Download the Gallery 2 Pre-Installer and put a single file on your webserver
- After two clicks, Gallery 2 is ready to be configured.
This is a great alternative for users who do not have the option of extracting .zip or .tar files directly on the webserver.
Note: If you use the Gallery 2 Pre-Installer to get a Gallery 2 Instance onto your webserver, your files and folders MAY be owned by the webserver user and not by your account on the webserver. This can complicate upgrading to future versions but Gallery 2 ships with an easy to use tool that allows you to resolve this with a single click.
- Download the Gallery 2 Pre-Installer to your computer. GET IT HERE
- Extract the Gallery 2 Pre-Installer zip file.
- Open the extracted preinstall.php in Wordpad, notepad or another texteditor.
- Enter a passphrase at the top of the file.
- Upload preinstall.php via FTP or another method to your webserver, e.g. to http://www.example.com/preinstall.php
- Use your FTP program to change the permissions of the folder where preinstall.php is in to 777 (read+write+execute permission for everybody).
- Browse with your webbrowser to the location where you have uploaded preinstall.php. In our example, that would be http://www.example.com/preinstall.php
- Enter the password that you just added to preinstall.php in the web form when prompted.
- Follow the on screen instructions.
- With your FTP program, move your Gallery 2 folder to e.g. gallery_old.
- Use the preinstall.php script to get a Gallery 2 Instance onto your webserver.
- If necessary, use the preinstall.php script to rename your Gallery 2 folder to e.g. gallery.
- Copy config.php and .htaccess to your new gallery folder.
- Run the upgrader as usual (browse to your gallery, it will start automatically).
- Use the chmod tool of your Gallery 2 Instance (http://www.example.com/gallery2/lib/support/index.php?chmod) to prepare your gallery folder for the upgrade (open up the filesystem permissions).
- Put the preinstall.php script into the same folder as your Gallery 2 Instance (not into gallery2/main.php. Put it one folder higher.)
- If your Gallery folder is not gallery2, use the preinstall.php script to rename your old Gallery folder to Gallery 2
- Use the preinstall.php script to get the latest Gallery 2 version onto server. (Download)
- Use the preinstall.php script to extract the new version over your existing gallery2 folder.
- Use preinstall.php to rename gallery2 to your original folder name, if you had a different name.
- Delete preinstall.php (leaving it on your server poses a security risk).
- Run the upgrader as usual (browse to your gallery, it will start automatically).
- Use the chmod tool (lib/support/) to secure your Gallery 2 folder again. Maybe also click fix Gallery Storage folder after securing the Gallery folder.
Switching from a Gallery 2 Instance Installed with the Gallery 2 Pre-Installer to a Standard Installation
- NB: You can skip these instructions if you are running PHP-CGI or PHP-FPM. With these PHP modes, your site will already have been configured ready to accept updates.
- Use the chmod tool of your Gallery 2 Instance (http://www.example.com/gallery2/lib/support/index.php?chmod) to prepare your gallery folder for the upgrade (open up the filesystem permissions).
- Rename your Gallery 2 folder to something like "gallery_old"
- Put your new Gallery 2 folder on the webserver with whatever non-Pre-Installer method since you want to get rid of a server-owned Gallery 2 Instance.
- Copy config.php and .htaccess from your old to your new Gallery 2 folder.
- If the new Gallery 2 folder is also a new version of Gallery 2, run the upgrader.
- Make sure everything is working when using your new folder.
- If so, you can now safely delete your old gallery_old folder.
All of them work. If available, choose Curl or wget since they are pretty efficient. Fsockopen and fopen on the other hand are better if the transfer takes a long time and wget and cURL time out for you.
If available, go with any of the zip methods or with the PHP based tar. The tar binary could have some problems with very long paths.
The tool to change file permissions (change mode, or in short, chmod) is in http://www.example.com/gallery2/lib/support/index.php?chmod.
Also see: How can I fix the filesystem permissions of the Gallery storage folder?
If you installed Gallery 2 with the Gallery 2 Pre-Installer, you need to first open the modules/ and themes/ directory for access before you can upload a theme or module manually yourself.
- Go to your site, sign in with your Gallery 2 setup password and follow the Filesystem Permissions link.
- Click on "Add a new module or theme (make modules/ and themes/ writeable)" to open up your themes/ and modules/ folders.
- Now you can upload your theme or module via FTP.
- Finally do not forget to close the themes/ and modules/ folders again on the "Filesystem Permissions" page.
- Note that you can fetch new modules and themes directly via the Site Admin -> Plugins page. FTP is not needed unless for modules and themes that are not in the available repositories.
The chmod tool can only change the filesystem permissions of files and folders that are owned by the webserver. Probably, some or all of your files / folders are owned by your account. If you don't use the Gallery 2 Pre-Installer anyway, just forget about the chmod tool. Probably you don't need it.
If you are a Gallery 2 Pre-Installer user and need it to work, ask your web hosting provider to run chown -R www /path/to/your/gallery/ since maybe your web hosting provider accidentally changed the owner when restoring a backup or because they thought that was the right thing to do.
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://www.example.com/gallery2/lib/support/ on the Filesystem Permissions page.
-
You can also try to change the permissions to 777 (read/write 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 web hosting provider to change the filesystem permissions recursively for you (e.g. chmod -R 777 g2data).
-
What might help is removing all cached data from the storage folder. Please see Gallery 2 FAQ: How can I clear cached data?
-
A common issue is:
Error (ERROR_PLATFORM_FAILURE) : in modules/core/classes/GalleryTemplate.class at line 123 (gallerycoreapi::error) in modules/core/classes/GalleryTemplate.class at line 456 (gallerytemplate::_initcompiledtemplatedir)
In such cases, if the above suggestions do not help, delete g2data/smarty/templates_c/ folder via FTP or whatever tool you use to upload / manage files on your website.
-
If the problem is not resolved or reappears after a while, ask your web hosting provider whether there are any scripts that change the owner of the files to the account owner.