Installation problems May 26, 2013 / Updated: June 13, 2022
Notes about deprecated functions
In the process of adding features and improving Zenphoto we occasionally find we need to change the way something worked in the past. Thus we may make some theme functions obsolete. When this happens we try to maintain the old function name to keep un-migrated themes working. But we move these functions to a plugin named "deprecated-functions" so that sites which are up-to-date do not have the overhead of having them loaded each page refresh. This plugin will cause an error notification upon use of the function so that you will know your theme needs to be updated. Generally this notification will explain what needs to be updated.
These messages can be annoying once you know that theme modification is needed. So, the plugin also has options that let you disable the message on those functions that you recognize need replacing. Disable the message and your theme will work as it did in the prior release. But NOTE: The implementation of the replacement functions in the plugin may not survive the test of time. There will be no attempt to keep these functions working as Zenphoto matures. If you get these deprecated function notifications, upgrade your theme at your earliest convenience.
Problems installing on certain hosts
If you don't have thumbnails you will need to open up the .htaccess file and add the following line to it if you are running php4.
AddType x-mapp-php5 .php
A tutorial by our user bensp: https://forum.zenphoto.org/discussion/316/how-to-install-zenphoto-on-dreamhost-a-guide
Problems installing or upgrading using SimpleScripts or other install helpers
We don't support using installtion helper scripts like SimpleScripts and we don't know what these are doing. If you have problems please ask the creators of SimpleScripts or your host. There are frequent reports that especially upgrades are often not working as expected.
Getting 500 error on accessing the site
There are several possibilities for this error.
- Mod rewrite may not work on your installation. Correct this by un-checking the mod rewrite checkbox on the General options tab, URL options.
- There may be file permissions issues on your site. Some servers are configured not to allow scripts to run if the script file security is too loose. Check especially the root index.php script. Your host can tell you what these file permissions must be.
- You may not have the Apache autoindex_module installed. There is a line in several .htaccess files Zenphoto uses (the root .htaccess, one in the zp-data folder, and one in the cache folder) which is intended to prevent directory browsing of the folder(s). This line reads IndexIgnore * Remove this line.
What is phpinfo() ?
PHPInfo() is a method by which you can get a HTML (browser-based) report on your version of PHP which is installed on your webserver, and also any information about installed modules relating to your ISP or webhost configuration of PHP. It provides very useful information for supporting zenphoto, as it will help us to determine vital information about your server.
- Open a new text document in your favorite text editor.
- Add the following line to the document: <? phpinfo(); ?>
- Save the document as phpinfo.php and upload it to your webserver in a web-accessible location.
- Execute the document by pointing your browser to the file (e.g.http://www.yourhost.com/locationoffile/phpinfo.php
About magic_quotes and why they should be disabled
To quote from the PHP manual itself:
Warning This feature has been DEPRECATED and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.
You can disable magic_quotes_gpc by editing your PHP.ini file. Change the line
magic_quotes_gpc = Onto
magic_quotes_gpc = OffYou can also disable magic_quotes_gpc in your zenphoto .htaccess file by adding the line
php_value magic_quotes_gpc offPlease contact your hosting provider for further assistance.
What it is
mod_rewrite is an Apache module for translating URLs. In zenphoto with mod_rewrite enabled,https://www.zenphoto.org/zenphoto/impressionists/ is the URL you see (even though the album is stored at /zenphoto/albums/impressionists on the server -- the two are related, but not the same). Then, mod_rewrite translates the requested /zenphoto/impressionists into/zenphoto/index.php?album=impressionists! They're the same! The first URL, which looks like paths to a folder, is called "pretty" or "cruft-free", because it's user-friendly and easy to remember. Pretty cool huh?
If you get "404 - Page Not Found" errors and images that don't show up, you probably have told zenphoto to use mod_rewrite, but you don't have it enabled on your server. You should set the configuration option mod_rewrite to false. Logon to Admin, click on the Options tab then theGallery configuration tab. Uncheck the box for Enable mod_rewrite and press the Apply button.Or you can read the next question to see how to turn it on.
How to enable it
First, mod_rewrite is an Apache module, so it requires Apache. If you're on a shared web host, you'll have to e-mail them and ask for it. Most large web hosts that use Apache will have it enabled already, but yours may not, it's not uncommon. When the apache module mod_rewrite is not loaded, you can´t use mod_rewrite within your ZenPhoto configuration. Via phpinfo() you can look to see if mod_rewrite is listed as loaded module. If is not, you can load it by open the httpd.conf of your apache and uncomment (delete the leading #) or add this line:
LoadModule rewrite_module modules/mod_rewrite.so
Secondly, you need have the correct.htaccess file in your zenphoto installation. If you have copied the one from the distribution, Setup will have updated it to your configuration. Otherwise, make sure the RewriteBase line is correct. It should be the URL to your zenphoto after the domain name. For example, the RewriteBase for https://www.zenphoto.org/zenphoto looks like RewriteBase /zenphoto .
Third, you need to make sure mod_rewrite option is enabled (see the last question.)
Getting the file structure shown instead of the site
Clearly the problem is that index.php isn't set as a default file for directories under Apache (or whichever server you're using).
- If it's Apache and you have access to your server's main Apache config file, you need to edit your apache.conf or httpd.conf and find the DirectoryIndex line. It should read:
DirectoryIndex index.html index.htm default.html or something similar.
Change it to:
DirectoryIndex index.html index.htm default.html index.php and whichever other directory default files you want, but definitely add the index.php to that line :) That should do it.Read more here: https://httpd.apache.org/docs/current/mod/mod_dir.html
- If you have no access to the main config file, create a file called index.html (This is the file that Apache looks for (This is set up in http.conf)) and write a redirect code to point to the index.php file.
Safe mode is generally considered bad practice for web hosts and users, as it breaks many programs and does not provide any real improvement in security.
1.0.8 and above should now be compatible with PHP safe mode. There may still be problems uploading using the administrator's interface while in safe_mode. This problem is not possible to fix, as in safe_mode it is impossible to both create a folder and write to that folder using the web server alone. You may only upload to existing folders that you've created using FTP upload. To get around this, we recommend you upload via FTP, or create the folders you want using FTP, and also ask your host to turn off safe mode as noted above.
This text by www.zenphoto.org is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Code examples are released under the GPL v2 or later license