« Back to zenphoto.org

Zenphoto FAQ

Here you can find answers to some of the most frequently asked questions about Trac. If you have a question not answered on this page, you can ask it on the ZenphotoForums. See the ZenphotoSupport page for more options on getting support for Zenphoto.


  1. Installation and Upgrading
    1. What system requirements do I need to install Zenphoto?
    2. What versions of PHP does Zenphoto support?
    3. Does Zenphoto work with PHP Safe Mode?
    4. How do I upgrade from an older version of Zenphoto?
  2. Troubleshooting Zenphoto
    1. I'm having a problem installing, what should I check first?
    2. When I have a problem with Zenphoto, where can I get help?
    3. My pictures are in /zenphoto/albums/MyAlbum but the URL says …
    4. What is mod_rewrite and how does it work?
    5. My host is 1&1, and I dont have thumbnails
    6. How do I enable mod_rewrite?
    7. I think I found a bug! What do I do?
    8. Someone's asking for a PHPInfo(), what is that?
    9. Help! My images aren't displaying after installation and setup!
    10. Why does Zenphoto make my server crash while processing images?
    11. I've upgraded from a previous version of Zenphoto, and my browser reports …
  3. Customizing Zenphoto
    1. I only see 5 albums on my front page, and 15 images on my album pages, …
    2. Can I integrate Zenphoto with Wordpress?
    3. Can I extend the functionality of Zenphoto myself?
    4. Where is the SVN Repository?
  4. Theming Zenphoto
    1. How can I install a theme designed by someone else?
    2. Where can I find custom themes?
    3. How do I make a custom theme?


Installation and Upgrading

What system requirements do I need to install Zenphoto?

To operate Zenphoto efficiently, you need:

  1. A web server with at least 10Mb of free space (plus free space for images and cache files)
  2. Apache or IIS (Apache recommended)
  3. PHP 4.1.0 or greater, with the GD graphics library (usually built-in)
  4. MySQL 3.23 or greater

See ZenphotoInstall for more information.

What versions of PHP does Zenphoto support?

Zenphoto supports PHP version 4.1.0 or greater, in theory. It may work with PHP versions as low as 4.0.6, but use 4.1.0 or greater just to be safe. We haven't tested it with versions lower than 4.2.3 -- if anyone has any problems with older PHP versions, please let us know in the ZenphotoForums.

Does Zenphoto work with PHP Safe Mode?

The PHP Manual says this about Safe Mode: "PHP Safe Mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now."

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. We generally recommend contacting your host to tell them you want Safe Mode disabled, then if they refuse, start looking for a new host (but that's just what we would do). If you're sticking where you are, you can go back to a previous version of Zenphoto that was more compatible, 1.0.3. It can be found in the files directory. Since this seems to be a bad problem, we're working on adding a safe-mode compatibility mode to the next release.

1.0.8 and above should now be compatible with PHP safe mode. If any problems occur in a safe_mode configuration, please report a New Ticket describing the problem.

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.

How do I upgrade from an older version of Zenphoto?

Upgrading is relatively easy to accomplish.

  1. Backup your MySQL database before proceeding.
  2. Download the latest distribution from http://www.zenphoto.org
  3. Extract the files to a local directory.
  4. If your upgrade is from 1.0.3 to another higher version, you will need to update your zp-config.php file. This is because we now use the KSES library, which requires extra config entries. To do this, just open the zp-config-example.php file, copy your settings from your old zp-config.php file to the new zp-config-example file, and save it as zp-config.php. Then proceed to step 5. With version 1.1.3 we recommend you make note of the mySQL configuration information in your zp-config.php file and rename it to zp-config.php.old. Setup will create a new file for you and prompt you for the mySQL configuration information.
  5. Double-check your .htaccess file if you're using Apache, and make sure you have the correct path for the RewriteBase line at the top. Version 1.1.3 of setup.php will check (and possibly correct) this for you.
  6. You can upload the entire contents of the directory, replacing files as needed (alternatively, you could do all of the above from your server command line if you have shell access).
  7. Once the files are uploaded, go to http://www.yoursite.com/your-zenphoto-folder/zp-core/setup.php and follow the instructions.
  8. You're done! Enjoy.

See ZenphotoUpgrade for more detailed instructions about each new version.


Troubleshooting Zenphoto

I'm having a problem installing, what should I check first?

Make sure you've:

  1. Downloaded files for latest zenphoto release.
  2. Uploaded everything to your web server (including .htaccess file in root zenphoto directory)
  3. Changed zp-config.example file to zp-config.php and made modifications as necessary.For version 1.1.3 or higher run the setup.php program and correct any problems it notes.
    • Make sure you set mod_rewrite to true if you wish
    • Make sure you set your admin information, and your correct DB information (including the prefix if you have one)
    • If upgrading from a version before 1.0.4, make sure you copy the new kses configuration parameters near the bottom.
  4. Change your rewrite-base in your .htaccess file to your root zenphoto path as seen from the web. This is checked by the 1.1.3 setup program.
  5. Make sure you have an albums and cache directory (create them manually if you don't) and chmod them 777 (the web server's user must be able to read and write in each directory). This is covered by the 1.1.3 setup program
  6. Upload the pictures you want into your albums directory, and organize them how you wish in folders and subfolders (zenphoto will currently only handle the subalbums if you're using the subalbums testing-dev theme).
  7. After this is all done, go to http://www.yourwebserver.com/your-zenphoto-folder/zen/setup.php and follow the steps. This sets up your DB and gets everything ready. It then will allow you to either administrate or view your gallery. I suggest administration, check your theme, I usually run "refresh" (garbage collection) on the Overview page just for kicks, and then you should be good to go.

And head to ZenphotoInstall for more detailed instructions, or go to the ZenphotoForums for help.

When I have a problem with Zenphoto, where can I get help?

See ZenphotoSupport, keep reading this page, or go straight to the Support Forums.

My pictures are in /zenphoto/albums/MyAlbum but the URL says /zenphoto/MyAlbum! It's wrong!

No, it's not! The URLs are correct as Zenphoto makes them. They aren't supposed to have albums in them because they aren't pointing to the folder! They're rewritten by the Apache module mod_rewrite, which translates URLs into script arguments, in this case, inputs to zenphoto. Read the next question to find out how this works.

What is mod_rewrite and how does it work?

mod_rewrite is an Apache module for translating URLs. In zenphoto with mod_rewrite enabled, http://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. In zen/zp-config.php, edit the line $conf['mod_rewrite'] to read: $conf['mod_rewrite'] = false; Reset this option from the admin options/gallery configuration tab. Or you can read the next question to see how to turn it on.

My host is 1&1, and I dont 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

How do I enable mod_rewrite?

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.

Secondly, you need to edit the .htaccess file in your zenphoto installation and make sure the RewriteBase line is correct. It should be the URL to your zenphoto after the domain name. For example, the RewriteBase for http://www.zenphoto.org/zenphoto looks like RewriteBase /zenphoto.With version 1.1.3 the setup program will have checked (and possibly fixed) your RewriteBase.

Third, you need to make sure mod_rewrite is enabled in your admin options/gallery configuratrion tab.

I think I found a bug! What do I do?

If you think you've found a bug, first check for a new version and upgrade if you find one. If that doesn't fix the problem, then search for the bug, look for a similar bug, and if you still think we don't know about it, submit a ticket! Be as thorough as possible and include your server configuration (Apache version, PHP version, etc.) and a detailed description.

Someone's asking for a PHPInfo(), what is that?

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.

This is how you can display your PHPinfo():

  1. Open a new text document in your favorite text editor.
  2. Add the following line to the document: <? phpinfo(); ?>
  3. Save the document as phpinfo.php and upload it to your webserver in an web-accessible location.
  4. Execute the document by pointing your browser to the file (e.g. http://www.yourhost.com/locationoffile/phpinfo.php

This will output a large amount of very useful information for you to peruse. You can provide this link to the support forum as a means to help us troubleshoot your configuration. You should delete the file once the issue has been resolved just to be safe.

Help! My images aren't displaying after installation and setup!

There are a number of reasons why you photos might not display after installation and setup.

  1. You may need to check your permissions on your albums directory and cache directory. The permissions should be 777 to allow Zenphoto to display everything properly.
  2. It could be that PHP Safe Mode is enabled. Your ISP will need to help you with this configuration. You can obtain more information in the FAQ item entitled "What is PHP Safe Mode?"
  3. Check your .htaccess file if you're using Apache, and make sure you have the correct path for the RewriteBase line at the top. If you're not using Apache or it doesn't seem to be working, turn $conf['mod_rewrite'] to false in zp-config.php.
  4. Search the ZenphotoForums for help, or start a new topic there. Zenphoto has a very helpful community, so don't be shy!

Why does Zenphoto make my server crash while processing images?

If you're running a web server on a VPS or other resource-limited environment, then you might not have enough memory available to the server to process very large images. You can use the following table as a guideline to see how much memory you need available to process images of different sizes:

  • VGA Image, 640 x 480 pixels => needs ~4.1 MB Memory
  • SVGA Image, 800 x 600 pixels => needs ~4.8 MB Memory
  • 1 MP Image, 1024 x 798 pixels => needs ~6.3 MB Memory
  • 2 MP Image, 1600 x 1200 pixels => needs ~11.7 MB Memory
  • 6 MP Image, 2816 x 2112 pixels => needs ~22.6 MB Memory
  • 8.2 MP Image, 3571 x 2302 pixels => needs ~41.7 MB Memory

As you can see, the 8.2-Megapixel 3571x2302 image requires a very large amount of memory to process, and that's simply because of the number of pixels. It doesn't matter if the image is only 2 or 3 megabytes when compressed in JPEG form, or what colors the image contains or anything-- it's just how big it is, because all of those pixels have to have a place in memory while the GD library processes them. There's no way around it!

Another problem is that browsers often make two requests per server at the same time to speed up image loading. This is perfectly normal, but if two requests for that 8-megapixel image are made and both need processing, then the memory requirement is doubled. The only way around this is to limit the number of requests your browser makes. In Firefox, this can be done by going to about:config as the URL and searching for the network.http.max-persistent-connections-per-server option and setting it to 1.

In future versions of Zenphoto, ImageMagick may be an optional image processor, which may require less memory, and at least won't share memory with Apache.

I've upgraded from a previous version of Zenphoto, and my browser reports a series of repeating error messages.

You may see messages like this on your page once you reload after upgrading:

Warning: Invalid argument supplied for foreach() in /var/www/yourdomain.com/zenphoto/zen/kses.php on line 429

This is related to a small change (addition of the KSES library) that was made in the zp-config.php file included with the new version. Just open the zp-config.php.example file, and copy your settings from your old zp-config.php file to the new zp-config.php.example file, and then save it as zp-config.php. Replace it on your web server.


Customizing Zenphoto

I only see 5 albums on my front page, and 15 images on my album pages, where can I change this?

You can correct this in the zp-config file. At about line 98, look for:

// Paging options:
// Control of their display is done in the theme, so you might need to change these
// after switching themes to make it look better.
$conf['albums_per_page'] = 5;
$conf['images_per_page'] = 15;

You can just change the albums_per_page parameter from 5 to 6 (or whatever you want). The same is true for images_per_page, which controls how many images are displayed per page within an album.

Can I integrate Zenphoto with Wordpress?

At this time, officially, no. There are plans to make this a reality soon. You can review the roadmap for Zenphoto for more information.

Technically, there are many ways to "integrate" the two applications. See ZenphotoPlugins and ZenphotoThemes for some WordPress plugins and Zenphoto themes that could help.

Currently, the recommended way to match the look of your Zenphoto site to your WordPress site is to create a zenphoto theme using the CSS and HTML from your WordPress theme. Search for "Wordpress" on the ZenphotoForums for more possible tips from those who have succeeded.

Can I extend the functionality of Zenphoto myself?

Yes, you can. Although bear in mind code changes to the core Zenphoto code may make upgrading difficult later on, and generally hacks have little or no support. You can browse to the ZenphotoHacks wiki page and see what's available.

Where is the SVN Repository?

The SVN Repository can be viewed by using the Trac Browse Source feature, which has a link at the top of this page. The URL of the repository itself is http://www.zenphoto.org/svn for exports and checkouts. See DeveloperReference for more info.


Theming Zenphoto

How can I install a theme designed by someone else?

Usually, the distribution of a theme comes with instructions on how to install the theme. For those instances where instructions don't exist, here is a basic set of installation instructions for installing themes:

  1. Download the theme of your choice.
  2. Expand the zip archive to a local folder.
  3. Upload the extracted folder (keeping the underlying folder structure intact) to your zenphoto\themes directory.
  4. Go into your admin>options tab and choose your theme.
  5. View your gallery with the new theme in place!

Note: Some themes have custom mods or things that need to be changed in addition to the normal theme installation. So take care to note in the theme distribution what these may be before you install.

Where can I find custom themes?

You can find custom themes at ZenphotoThemes, or from the theme creator's site. Links to the theme locations that are submitted to the TRAC wiki will be placed from this FAQ soon.

How do I make a custom theme?

There will soon be a custom theme document outlining the best ways to create a zenphoto theme. As soon as it's created, we'll link to it from here as well.