Page 1 of 1

[SOLVED] paths in config/split paths for writable data and other files

Posted: Fri Apr 25, 2008 8:27 pm
by sirab
Hi,

I am working with CMSMS 1.2.4 on my own server to test and it works great. Now I have installed it on another server which has 1 odd thing: the path for the writable data directory is different from the normal path.
So lets say my normal path is /site/www . This directory is not writable for my server. There is another data directory with path /site/data.

So I thought I would just put the /site/www as root_path (in the config) and /site/data/tmp/cache and /site/data/uploads as the tmp and upload dirs because they need to be written to (and that can only be done in de data dirs).

I dont yet know if I will encounter a problem with modules (since this also need to be writable), but I am faced with my first problem:
It seems that even though I have set the tmp/cache path, in the admin when I want to preview a page (I have transferred all pages and data from my old server, so that is why I can enter the admin and there are some pages there) I get the following error:
string(94) "Smarty error: problem creating directory '/site/www/tmp'" string(135) "Smarty error: the $compile_dir '/site/www/tmp/templates_c' does not exist, or is not a directory."

So am I correct in thinking that here it does not take the tmp/cache path from the config? Because it takes the root and puts tmp/ and tmp/templates_c behind it.

Is it even possible to have split paths, one for writeable directories and one for the rest?

Sincerely,
Sirab

Re: paths in config/split paths for writable data and other files

Posted: Fri Apr 25, 2008 8:55 pm
by alby
sirab wrote: I am working with CMSMS 1.2.4 on my own server to test and it works great. Now I have installed it on another server which has 1 odd thing: the path for the writable data directory is different from the normal path.
So lets say my normal path is /site/www . This directory is not writable for my server. There is another data directory with path /site/data.

So I thought I would just put the /site/www as root_path (in the config) and /site/data/tmp/cache and /site/data/uploads as the tmp and upload dirs because they need to be written to (and that can only be done in de data dirs).

I dont yet know if I will encounter a problem with modules (since this also need to be writable), but I am faced with my first problem:
It seems that even though I have set the tmp/cache path, in the admin when I want to preview a page (I have transferred all pages and data from my old server, so that is why I can enter the admin and there are some pages there) I get the following error:
string(94) "Smarty error: problem creating directory '/site/www/tmp'" string(135) "Smarty error: the $compile_dir '/site/www/tmp/templates_c' does not exist, or is not a directory."
You must edit fileloc.php also.
For modules, install via files and not ModuleManager

Alby

Re: paths in config/split paths for writable data and other files

Posted: Fri Apr 25, 2008 9:07 pm
by sirab
Thanks for your fast reply.

In fileloc.php I see the following:
define("CONFIG_FILE_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.php');
define("TMP_CACHE_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'cache');
define("TMP_TEMPLATES_C_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'templates_c');

How do I change this for my situation?
And I don't see the tmp directory itself or even the modules directory to be defined. Can I define the tmp path itself somewhere also (so not only the tmp/cache)?

Sincerely,
Sirab

Re: paths in config/split paths for writable data and other files

Posted: Fri Apr 25, 2008 9:17 pm
by alby
sirab wrote: Thanks for your fast reply.

In fileloc.php I see the following:
define("CONFIG_FILE_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.php');
define("TMP_CACHE_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'cache');
define("TMP_TEMPLATES_C_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'templates_c');

How do I change this for my situation?
And I don't see the tmp directory itself or even the modules directory to be defined. Can I define the tmp path itself somewhere also (so not only the tmp/cache)?
In this moment I don't remember use of tmp directory only ....
for fileloc:
define("TMP_CACHE_LOCATION", "/site/data/tmp/cache");
define("TMP_TEMPLATES_C_LOCATION", "/site/data/tmp/templates_c");

you cannot modify admin,lib,modules,plugins directories

Alby

Re: paths in config/split paths for writable data and other files

Posted: Fri Apr 25, 2008 10:11 pm
by sirab
I found it. I did:
define("TMP_CACHE_LOCATION", '/site/data/tmp/cache');

etc.

That worked. Thanks

Re: paths in config/split paths for writable data and other files

Posted: Sat Apr 26, 2008 1:39 pm
by calguy1000
the tmp directory itself is used for various file uploads, and downloads, and for the template externalizer and other modules.  It is recommended that you not change this structure as it may break something.