MyBB Documentation

inc/config.php

The 1.6 Documentation is no longer maintained and some information may be outdated.

The MyBB 1.6 series reached end of life on October 1, 2015.

This means there will be no more security or maintenance releases for these series and forums running these versions of MyBB may be at risk of unfixed security issues. All administrators are strongly encouraged to upgrade their forums to the latest release of MyBB as soon as possible.

The inc/config.php file stores the database information, and various global configuration settings. This file is written during the installation, so it is not necessary to create this file yourself.

This file must be writable by the server during installation. This file may be CHMODed after installation to 644 or similar, to prevent writing over the file by malacious users.

Contents

This is a sample inc/config.php if you have accidentally overwritten your existing one.

Sample

<?php
/**
 * Database configuration
 *
 * Please see the MyBB Wiki for advanced
 * database configuration for larger installations
 * http://wiki.mybb.com/
 */

$config['database']['type'] = 'mysql';
$config['database']['hostname'] = 'localhost';
$config['database']['username'] = 'mysql-username';
$config['database']['password'] = 'mysql-password';
$config['database']['database'] = 'database-name';
$config['database']['table_prefix'] = 'mybb_';

/**
 * Admin CP directory
 *  For security reasons, it is recommended you
 *  rename your Admin CP directory. You then need
 *  to adjust the value below to point to the
 *  new directory.
 */

$config['admin_dir'] = 'admin';

/**
 * Hide all Admin CP links
 *  If you wish to hide all Admin CP links
 *  on the front end of the board after
 *  renaming your Admin CP directory, set this
 *  to 1.
 */

$config['hide_admin_links'] = 0;

/**
 * Data-cache configuration
 *  The data cache is a temporary cache
 *  of the most commonly accessed data in MyBB.
 *  By default, the database is used to store this data.
 *
 *  If you wish to use the file system (cache/ directory), MemCache or eAccelerator
 *  you can change the value below to 'files', 'memcache' or 'eaccelerator' from 'db'.
 */

$config['cache_store'] = 'db';

/**
 * Super Administrators
 *  A comma separated list of user IDs who cannot
 *  be edited, deleted or banned in the Admin CP.
 *  The administrator permissions for these users
 *  cannot be altered either.
 */

$config['super_admins'] = '1';

/**
 * Database Encoding
 *  If you wish to set an encoding for MyBB uncomment
 *  the line below (if it isn't already) and change
 *  the current value to the mysql charset:
 *  http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html
 */

$config['db_encoding'] = 'utf8';

/**
 * Automatic Log Pruning
 *  The MyBB task system can automatically prune
 *  various log files created by MyBB.
 *  To enable this functionality for the logs below, set the
 *  the number of days before each log should be pruned.
 *  If you set the value to 0, the logs will not be pruned.
 */

$config['log_pruning'] = array(
	'admin_logs' => 365, // Administrator logs
	'mod_logs' => 365, // Moderator logs
	'task_logs' => 30, // Scheduled task logs
	'mail_logs' => 180, // Mail error logs
	'user_mail_logs' => 180, // User mail logs
	'promotion_logs' => 180 // Promotion logs
);

?>

Database Configuration

$config['dbtype']
This is the database driver that is used for your board. mysql, mysqli, sqlite2, sqlite3 and postgresql are supported.
$config['hostname']
This is the hostname to your database server
$config['username']
This is the username to connect to your database server.
$config['password']
This is the password to connect to your database server.
$config['table_prefix']
This is the table prefix for the MyBB tables.
$config['db_encoding']
This is the database encoding used interpret characters

Admin CP URL

$config['admindir']
If you are changing your Admin CP folder name, you should change this to the name of that renamed directory (without preceding or trailing slash).

Hide Admin CP Links

$config['hide_admin_links']
If you wish to hide all Admin CP links on the front end of the board after renaming your Admin CP directory, set this to 1.

Datacache Configuration

$config['cachestore']
This is the method of storing the datacaches (either 'db', 'memcache', 'eaccelerator' or 'files'). In order to use Memcache or eAccelerator, you must have them installed on your server.

Super Administrators

$config['super_admins']
A comma separated list of user IDs who cannot be edited, deleted or banned in the Admin CP. The administrator permissions for these users cannot be altered either.

Database Encoding

$config['db_encoding']
This is the database encoding used to interpret characters. For a full list of encodings see http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html

Log Pruning

Log pruning is stored as an array in $config['log_pruning']. For any of these, if you set it to 0, the logs will not be pruned. Otherwise, set the number of days before each log is pruned.

admin_logs 
Administrator logs. Default is 365.
mod_logs 
Moderator logs. Default is 365.
task_logs 
Scheduled task logs. Default is 30.
mail_logs 
Mail error logs. Default is 180.
user_mail_logs 
User mail logs (both send thread to friend and email user). Default is 180.
promotion_logs 
User group promotion logs. Default is 180.

Edit this page on GitHub