All text is available under the terms of the GNU Free Documentation License. For the latest version of this document, see Wikibooks.

Zoph/Requirements

This document is meant to help you install all the packages required by Zoph. I've gotten everything running on Linux (Debian, Mandrake and Gentoo) and Mac OS X without too much trouble and people have reported getting Zoph to work under Windows as well. You might be able to skip this if you know your way around your system.

You need to have the following installed before running Zoph. Version numbers are what I have tested with, I expect any recent versions would work:

You probably already have many of these. Getting most of them is fairly simple. For example, using Debian you can simply:

$ apt-get update
$ apt-get install perl apache php4 mysql-server php4-mysql imagemagick jhead

If you are planning on using the web based importer you may need to install the GD 2 library for image support in PHP (http://www.boutell.com/gd/). A Debian package named php4-gd2 is available. Also, you may need to upgrade to PHP 4.2 if you want EXIF support. GD is required to use the importer. PHP 4.2 is recommended but not required.

Also, if you are using the web importer you may need to increase the max_execution_time defined in php.ini. There is more info in the MANUAL.

Contents

Apache & PHP

You may have to edit your httpd.conf file to add PHP support. Edit /var/apache/conf/httpd.conf (or the equivalent) and uncomment/add these lines:

LoadModule php4_module /usr/lib/apache2/modules/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Save the file and restart apache:

$ apachectl restart

Put a php file in your webserver's path to test things out: $ cat /var/www/test.php <? echo phpinfo(); ?>

Hit http://localhost/test.php and you should see info about your PHP version.

MySQL

If MySQL is not up and running you'll need to start it:

$ /etc/init.d/mysql start

If you haven't set your root password, do it!

$ mysqladmin -u root password <password>

MySQL version 4.1 and above (Zoph 0.4 and earlier)

If you are trying to install Zoph against MySQL version newer than 4.1, you will run into problems, when trying to login. It will always say your username and password are wrong. This is caused by the fact that from version 4.1, MySQL has changed the password encoding scheme from 16 bytes to 41 bytes. The password field in Zoph is 32 bytes long, and thus the new passwordlength does not fit. If you want to use v0.4 or before with a post-4.1 MySQL version anyway, you can change the size of the password field manually by running the following query in MySQL:

ALTER TABLE zoph_users CHANGE password password varchar(64); 

After that, you will need to change the admin password again, so it will be inserted into the database using the 'new' encoding.

UPDATE zoph_users SET password=password("admin") WHERE user_id=1; 

MySQL version 4.1 and above (Zoph 0.5 and later)

Zoph 0.5 has full support for MySQL > 4.1. Because Zoph 0.5 is able to transparently change passwords from the "old" password encoding to the "new" password encoding, it is recommended to first upgrade Zoph from 0.4 to 0.5 and after that, upgrade your MySQL version. If you are a new user and installing Zoph 0.5 for the first time, it does not matter which MySQL version you are running.

Perl Packages

You may already have the DBI, DBD::mysql and File::stat but you probably have to install the Image::Size package. You can use CPAN to do this. (Note that the first time you run CPAN you'll have to answer some questions. You can just go with the defaults until you are asked to choose the hosts).

$ perl -MCPAN -e 'install Image::Size'

If needed, install the other Perl packages as above.

Jhead

Jhead is a handy little program that extracts the information stored in the Exif headers that are added by most digital cameras. Exif stores date and time plus a bunch of other info about a photo. Zoph uses Jhead to parse the header so you'll need to install it. You can download it from:

http://www.sentex.net/~mwandel/jhead/