XF 2.2 is there a way to move the conf.php file to another directory behind like this /config.php/public_html/?

spirogg

Active member
Hi i was wondering if there is a way to get the conf file with database usernames passwords etc moved to another directory under www / public_html
example /home/user/ config.php/public_html/
this way it's safer ?
 
It's marginally safer if you think there's ever a situation that PHP won't be parsed in the src/ directory. Saying that, if you use Apache, we include a .htaccess file in that directory that means that it can't be accessed via the web. (We include a similar block for Nginx in our friendly URL setup, though it isn't something that we can enforce automatically like in Apache.)

But there isn't anything built-in to do that. If you really wanted to do that, you'd replace the contents of src/config.php with:
Code:
<?php
include('/path/to/new/config.php');
And it should work as is.
 
Back
Top Bottom