MyBB Community Forums

Full Version: Urgent buggered up config.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Please can someone correct this config.
Something small has been messed up when I edited..

<?php

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

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

$config['hide_admin_links'] = 1;

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

$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;

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


$config['database']['encoding'] = 'utf8';

$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 );

?>
you can put comment tag (//) before $config['log_pruning']
or remove all comment tags at the bottom of the file
fixed. for others it was this area

'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
);

many thanks

still not 100%

Can you advise if this section is ok please..?


$config['database']['encoding'] = 'utf8';

$config['log_pruning'] = array(
'admin_logs' => 365,
'mod_logs' => 365,
'task_logs' => 30,
'mail_logs' => 180,
'user_mail_logs' => 180,
'promotion_logs' => 180);

?>

(2013-11-25, 11:03 AM)djpete1959 Wrote: [ -> ]fixed. for others it was this area

'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
);

many thanks

still not 100%

Can you advise if this section is ok please..?


$config['database']['encoding'] = 'utf8';

$config['log_pruning'] = array(
'admin_logs' => 365,
'mod_logs' => 365,
'task_logs' => 30,
'mail_logs' => 180,
'user_mail_logs' => 180,
'promotion_logs' => 180);

?>

Also getting these errors.
All I edited was config, nothing else..

[attachment=30593]

this is the latest config but I still have errors and cant stay logged in..

<?php

$config['database']['type'] = 'mysqli';
$config['database']['database'] = '';
$config['database']['table_prefix'] = 'mybb_';
$config['database']['hostname'] = 'localhost';
$config['database']['username'] = '';
$config['database']['password'] = '';

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

$config['hide_admin_links'] = 1;

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

$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;

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


$config['database']['encoding'] = 'utf8';

$config['log_pruning'] = array(
'admin_logs' => 365,
'mod_logs' => 365,
'task_logs' => 30,
'mail_logs' => 180,
'user_mail_logs' => 180,
'promotion_logs' => 180);

?>

pls can anyone advise?
(2013-11-25, 11:03 AM)djpete1959 Wrote: [ -> ]this is the latest config but I still have errors and cant stay logged in.
Your inc/config.php file content seems to be ok, assuming that you also have correct values for:
$config['database']['database'] = '';
$config['database']['username'] = '';
$config['database']['password'] = '';

For example, this is my "config.php":
<?php
/**
 * Database configuration
 *
 * Please see the MyBB Docs for advanced
 * database configuration for larger installations
 * http://docs.mybb.com/
 */

$config['database']['type'] = 'mysqli';
$config['database']['database'] = 'DATABASE_NAME';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'SERVER_NAME';
$config['database']['username'] = 'DATABASE_USERNAME';
$config['database']['password'] = 'DATABASE_PASSWORD';

/**
 * 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'] = 'MY_ADMIN_DIR'; // replace with your real "admin" dir

/**
 * 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'] = 1;

/**
 * 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, xcache, or eAccelerator
 *  you can change the value below to 'files', 'memcache', 'xcache' or 'eaccelerator' from 'db'.
 */

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

/**
 * Memcache configuration
 *  If you are using memcache as your data-cache,
 *  you need to configure the hostname and port
 *  of your memcache server below.
 *
 * If not using memcache, ignore this section.
 */

$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;

/**
 * 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['database']['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
);

?>

Anyway, try to clean your browser cache and access your forum again. If you get errors, tell us when you get that error: when you access "index.php" file or when you access "admin" dir? Also, what MyBB version you use?
care should be taken that there is no empty space or empty lines before <?php at the beginning
of the file and after ?> at the end of the file. also config.php file needs to be saved without BOM