I had all kinds of trouble getting Zenphoto to install on 1and1. None of which I believe are the fault of the Zenphoto project. I am blaming the difficulties on how you need to configure php on 1and1.
What problems did I have. It appears that there were tables that were not created correctly. The way I figured this out was that I was trying to save a ¬†guest user and password to¬†and album. The name wouldn’t stick. When I went in and look under the MySql admin¬†tool (phpMyAdmin), there was no user field in the albums table. Something was wrong right from setup.
So here are the steps that I came up with to get zenphoto installed properly. I can’t say that all of the steps I took were necessary, and some might even be suspect, but in total it works.
First of all, I am on a linux hosted shared server on 1and1. That is important, because of how php must be configured. The commands here need to be entered at the command line. You can ssh here, or use putty from windows, but this is not an explanation on how to do that.
I downloaded the current version which at this point is zenphoto-1.2.4.tar.gz.¬†To do this I used wget so I don’t need to transfer it after downloading. Then I expanded the archive and installed the files.
wget http://zenphoto.googlecode.com/files/zenphoto-1.2.4.tar.gz tar -xvzf zenphoto-1.2.4.tar.gz
Don’t do the setup yet.
I then went to the 1and1 web site, logged in and went to the MySQL Administration control panel. I selected to create a new database, and picked version 6. You can choose between 5 and 6. I picked 6. 1and1 will tell you the user name, password, host, and database name you will need to enter into setup, but don’t run setup yet.
We want to tell apache to use PHP5 instead of 4. To do this we want to modify the .htaccess file that comes with zenphoto. In that file are some rules for rewriteing. We don’t want to change those. Just add a couple of lines. To edit this file I typed
nano -w .htaccess
You need to add these two lines after the comment lines (with #’s) and before the <IfModule mod_rewrite.c> line
AddType xmapp-php5 .php AddHandler x-mapp-php5 .php
Now that is done press ctrl-X to exit, and say yes to saving. Don’t run set up yet. We have a couple more things to do.
Now we need to tell php to turn off magic quotes, and to use UTF character encoding. We do this by creating a php.ini file in the directory where the code is. This is the dumb part. You need this in every directory you have php code. I put it in the root of my zenphoto install, and in the zp-core folder. This is what I put there.
[PHP] magic_quotes_gpc = Off mbstring.internal_encoding = UTF-8
If you want to create this file, type
nano -w php.ini
Now copy the code above and press shift-insert in the terminal window. Then you can press ctrl-X and say yes to save.
I also copied this file to the zp-core folder
cp php.ini zp-core/
Just a note: There are instructions on the web that you can add these directives to your .htaccess file, but that will not work on 1and1 linux shared hosting. You will get a 500 server error. See here.
Ok, now you can run setup. Go to your browser and head to http://www.yourwebsite/zenphoto/ This will in turn tack the zp-core/setup.php to the end and start the setup. There will be a couple of warnings left. First one is about strict permissions. I clicked on the link, and zenphoto set things up how it wanted. Next is the .htaccess file. Ignore this one, because we modified the file. The time stamp should be different.
Now you can go ahead and enter you database information. Press OK, and zenphoto should tell you that everything is A OK. You will then set up an Admin user and password, then you are given the opportunity to log in.
If you want to check out the issue I had, upload some files to a new album. Then edit the album and put in a guest user and password and save. Log out, then click on the album you created and locked. Enter the name and password you entered for the guest user. If when you login you can see the album, you are good to go. When I did this process before this procedure, I would try to save the album with the guest user. The name would disappear once I pressed save. Then when I tried to log in I was given an error.
I hope that saves someone some hassles. Good luck.