MyBB Community Forums
Where to change the "config.php" location? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 Security Management and Support (https://community.mybb.com/forum-153.html)
+------ Thread: Where to change the "config.php" location? (/thread-148587.html)



Where to change the "config.php" location? - LCTG - 2013-12-03

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.


RE: Where to change the "config.php" location? - pavemen - 2013-12-03

\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


RE: Where to change the "config.php" location? - Oxygen - 2013-12-16

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.