MyBB Community Forums

Full Version: Weird errors in admin cpanel
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My site recently got hit with the wordpress virus, which infected all my site php files. I reuploaded the forum files to my site, but now I'm getting errors in the admin cpanel. Any idea how I can fix this? At the moment, I can't even log into the admin panel. Thanks in advance.

Warning [2] Cannot modify header information - headers already sent by (output started at /home/content/g/e/n/generalplot/html/forums/inc/config.php:2) - Line: 51 - File: admin/index.php PHP 4.3.11 (Linux)
File 	Line 	Function
[PHP] 	  	errorhandler->error
/admin/index.php 	51 	header
Warning [2] Cannot modify header information - headers already sent by (output started at /home/content/g/e/n/generalplot/html/forums/inc/config.php:2) - Line: 1548 - File: inc/functions.php PHP 4.3.11 (Linux)
File 	Line 	Function
[PHP] 	  	errorhandler->error
/inc/functions.php 	1548 	header
/admin/index.php 	210 	my_setcookie
Can you try uploading a fresh copy of ./inc/config.php, make sure though that you fill out the MySQL details etc. in it.
No need to do that.

There is a white space before the <?php delimiter in the inc/config.php file. Open this up in a text editor in cPanel and remove ALL white spaces or gaps before <?php at the top of the file.
As far as I can tell, my config.php file looks normal. Any idea what could be wrong? I replaced sql login info with x's intentionally for obvious reasons. Thanks again.

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

$config['database']['type'] = 'mysql';
$config['database']['database'] = 'xxxxx';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'xxxxx.xxx';
$config['database']['username'] = 'xxxxx';
$config['database']['password'] = 'xxxxx';

/**
 * 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)
 *  you can change the value below to 'files', 'memcache' 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' => 0, // 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
);

?>
Deleting it and making it again would be easiest. I assume you're opening this in notepad, there's hidden characters that are causing a problem. Use wordpad, not notepad, and remake it: [wiki]Inc/config.php[/wiki]
Actually, I'm looking at it in wordpad now and it looks exactly the same. No hidden or extra characters in it anywhere. I'll try using a new one and remaking it just to be sure though. Thanks.

Edit: I've just tried making a new config.php file and uploaded it to my site, but I'm still getting those errors.
What MyBB version are you running??
I've updated to the latest release.
There's something wrong with that file somewhere. Can you PM me FTP login details??