Configuration File

I have installed version 5.1 and have a configuration question. What is the proper way to add a configuration such as 'allow_registration' => '0'? Which config.php file do I insert it into? I tried to add it to the /config/config.php file but that does not work. I also created a config.php in the home directory but that didn't work either. I looked online before posting this but could not find the answer. I even modified the wacko_config table in the database and that didn't work.