Installing Contributed Modules

The process for installing a contributed module typically consists of the following steps:

1. Make a backup of your site's database. This is especially important if the module requires that changes be made to your database. Never neglect this step.

2. Copy the entire module folder into the modules directory of your Drupal installation. Usually, the whole folder can be copied, but you may want to exclude some files that don't need to be on the server. The .mysql and .pgsql files, for example, can be omitted.

3. Update the database schema, if necessary. For a MySQL database, use the following GNU/Linux command:

mysql -u user -p drupal < module.mysql

Replace user with the MySQL username, drupal with the database being used, and module .mysql with the .mysql file distributed with the module. If your database is using table prefixes, you will need to update the database definition file directly to reflect this.

4. Apply any patches, if necessary.

5. Enable the module by navigating to administer > modules (admin/modules) and checking its Enable box.

6. Configure the module, including setting new permissions defined by the module. As explained in Chapter 2, you administer permissions from administer > access control (admin/access).

A module will typically consist of the following files contained in a folder of the same name as the module:

• README.txt: Always start here. The README file will explain what the module is for, what it can do, and any extra information you might need in deciding whether or not to install the module.

• INSTALL.txt: This file will provide directions for installing the module.

• CHANGELOG.txt: This file contains a running account of how the module has been altered or updated. This information is useful if you are upgrading a module and want to see how the newest version differs from the version you are currently using.

• .module: This file contains the PHP code that makes the module work. It typically consists of the module-specific implementations of the relevant Drupal hooks, as well as any other code needed for the module.

The following are some of the optional files sometimes included with a module:

• .mysql and .pgsql: These files contain the SQL to build the database schemas that will be used by the module. Not all modules require altering the database schemas, and not all modules support both MySQL and PostgreSQL. This should be explained in the INSTALL file for the individual modules.

• update.php: If present, this file can be used to change from one version of a module to a newer version. Make sure to consult the INSTALL file directions before applying the updates.

• .patch files: These files are present if any other Drupal files, core or otherwise, need to be patched in order for the module to work.

• MAINTAINERS.txt: This file lists the people who have write access to the CVS repository and who are willing to fix bugs and perhaps add features to the module.

The following sections include specific instructions for installing each of the modules described.

0 0

Post a comment