MyBB Community Forums

Full Version: Where to change the "config.php" location?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to move the config file to another place, but I don't know where to change code in MyBB. Please help me.

Regards.
\inc\init.php has two references to config.php that you need to update.

edit: however, it is simpler if you just set the bare min permissions on the file. It does not need to be readable by anything other than the php user (actual account or nobody usually) and then chmod to 400. this makes it read only to php and no other user can view or access the file. just remember this when you need to edit it
Change your config.php filename, then put this as config.php:

<?
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
    exit('Denied.');
}

@include('yournewconfigname.php');
?>

Then simply update yournewconfigname.php with your new config name. No core edits have to occur then and your filename has been changed without hassle.