Location: PHPKode > scripts > PHP Users > php_users-1.0-b1/php_users-1.0-b1/INSTALL.txt
# These are the installation instructions for the PHP user
# management system.
# $Id: INSTALL.txt,v 2003/06/03 14:12:24 byrnereese Exp $

Note: Throughout these instructions, $PHP_USERS_HOME is mentioned. 
      This refers to the directory that php_users was unpacked into. 
      For example, if you untarred php_users into /usr/src, then
      $PHP_USERS_HOME would refer to /usr/src/php_users-0.x

1. Prerequisites

You will first need to install the following software packages before
actually installing and setting up php_users:

   * Apache (1.3.27 recommended and supported)
   * PHP >= 4.3.x
   * MySQL (3.23.x recommended and supported)
   * mcrypt support for PHP (optional, but recommended)

   1.1 Install prerequisites
   When installing PHP, be sure you configure PHP with mcrypt and mysql
   support. For example:
   % cd $PHP_SRC_HOME
   % ./configure --with-mysql \
                 --with-mcrypt \

2. Create the Users database(s)

First, import the table definitions into an exisiting database, or
create a dedicated database first, and import the table definitions into

In the directory in which you unarchived the php_users tarball you will 
find a file called 'schemas/mysql' - this file contains the table definitions 
needed to use php_users. To install it, simply run the following command:

   % mysql -u USER_NAME -p YOUR_DB < $PHP_USERS_HOME/schemas/mysql

3. Setup Apache 

Add the following lines to your Apache's httpd.conf file. This will setup
an alias to your users directory as well as add your php_users path to
your include path. 

    > Alias /users/ $PHP_USERS_HOME/htdocs
    > <IfModule mod_php4.c>
    >   AddType application/x-httpd-php .php
    >   php_value include_path ".:$PHP_USERS_HOME/include"
    > </IfModule>

4. Customize the PHP_USERS

The first thing you MUST do is edit the '$PHP_USERS_HOME/include/users.conf'
file. Follow the instructions within it. It should be clear 
enough <knock on wood>.

NOTE: Due to the Cookie specification, cookie domains must consist of
      at least two decimals, or periods ('.'). Therefore, be sure 
      $COOKIE_DOMAIN contains two decimals as the example does. You
      will *not* be able to cookie users for the 'localhost' since it
      can at most possess only one decimal ('.localhost').

5. Restart Apache

Now restart Apache. Be sure to watch your error logs and what not to
make sure Apache started without any problems.

6. Update your PHP applications

Now that it is installed, add the following at the top of your php scripts:

    > include("users.inc"); 

7. Read the README.txt
Return current item: PHP Users