Change local paths

Hi:



I’d like to change the location where the config files are written to. I noticed there’s a concept of paths_local.php. Is there an example of this file anywhere? Basically, instead of saving them in /app/config I need to put them in /var/config.



Cheers,

Dave

Hi:

I’d like to change the location where the config files are written to. I noticed there’s a concept of paths_local.php. Is there an example of this file anywhere? Basically, instead of saving them in /app/config I need to put them in /var/config.

Cheers,
Dave

Hi Dave, can you use a symbolic link to point app/config to var/config?

Hi:

Thanks for the reply…
In my case the only file system I can write to is /var. I’m porting Mautic over to run in Sandstorm. Basically, I need to override the default location where app/config currently writes to. Is it in AppKernel.php?

Cheers,
Dave

Have a look at app/config/paths.php

Here’s some more places to look. app/config/local.php, app/config/parameters.php

Have a look at lines 50 & 75 in app/config/parameters.php. Seems to me like you need to change the apps directory and leave config inside the apps directory. I haven’t come across a simple path variable yet to override the config folder location. The code in parameters.php doesn’t use one, it just looks for the config relative from where it’s located.

Can you put the entire install in var or var/apps? I think that’s important, because you also have the cache directory in apps which gets written to (and who knows what else).

This may be helpful too. http://symfony.com/doc/current/cookbook/configuration/override_dir_structure.html

Thanks a lot! I’ll check that out…
Cheers,
Dave

You’re welcome. I hope it helps. I think it’s going to be difficult to move config outside of the app directory. Good luck, and let me know how it goes.

-steve.

Moving it entirely is going to be tricky, but you might be able too. There are some settings for the log and root paths here:

That won’t change the configuration file location, though. what you’ll end up with is:

app/config/config-files here (you’ll only be able to modify via uploading the file contents)

Then set:
var/logs
var/cache

For the cache and log directories. The config file writability is only important when changing the config file (unlike cache and logs which must always be writable).

We haven’t tried to use Sandstorm but if it looks like a compelling environment we’ll figure out a way to support it. Right now we’ve got things on Docker and some other hosts - there’s lot of choice out there!