Topic: Define a "cache directory" constant

I all, I'm an italian programmer and I've this error:
"Unable to write configuration cache file to cache directory. Please make sure PHP has write access to the directory 'cache'"

Unfortunately I can't change directory right to "777" 'cause is locked by provider/mantainer (www.aruba.it).
I've only one public directory called "public" into my site root dir.

Now PunBB work correctly because I've simply changed 10-12 code lines...

I've a suggestion for PunBB developer:
you could create a simple CONSTANT called, for example, CACHE_DIR:

define('CACHE_DIR', '../../public');

and use this constant into "functions.php", "footer.php", "cache.php", "common.php" where "cache" directory are called...

In Italy thousand people who use www.aruba.it as provider/mantainer can't use PunBB!!!

Max

Re: Define a "cache directory" constant

Erm, writing it to a public folder isn't the best idea
I would talk to your ISP

Re: Define a "cache directory" constant

I know that isn't a good idea... sad
Unfortunately it is the only solution...

Tank you wink

Re: Define a "cache directory" constant

Since the folders weren't meant to be moved around anyway, a better idea (at least IMO) is a way to disable caching

Re: Define a "cache directory" constant

there is a problem though ... some mods use 'special' functions to remove cache ... instead of using Rickards cache functions ... so if there will be a change, those probably needs changing too (not that much work though, just wrote it as a reminder wink)

Re: Define a "cache directory" constant

maybe if this is implemented a clear_cache() function would be nice?

7 (edited by Frank H 2005-05-18 16:17)

Re: Define a "cache directory" constant

Rickard has a function that fixes the caches already (at leat the config cache)

    // ok, add the stuff needed in the config cache
    $attach_config = array(    'attach_always_deny'    =>    'html"htm"php"php3"php4"exe"com"bat',
                            'attach_use_icon'        =>    '1');
    
    foreach($attach_config AS $key => $value)
    {
        $db->query("INSERT INTO ".$db->prefix."config (conf_name, conf_value) VALUES ('$key', '".$db->escape($value)."')") or error('Unable to add column "'.$key.'" to config table', __FILE__, __LINE__, $db->error());
    }

    // and now, update the cache...
    
    require_once PUN_ROOT.'include/cache.php';
    generate_config_cache();

This is what I used for the attachment mod ...


Edit: Checked the config.php file ... it has generate_****_cahce() for each cachefile ...

Re: Define a "cache directory" constant

MaxEtere wrote:

I all, I'm an italian programmer and I've this error:
"Unable to write configuration cache file to cache directory. Please make sure PHP has write access to the directory 'cache'"

Unfortunately I can't change directory right to "777" 'cause is locked by provider/mantainer (www.aruba.it).
I've only one public directory called "public" into my site root dir.

Now PunBB work correctly because I've simply changed 10-12 code lines...

I've a suggestion for PunBB developer:
you could create a simple CONSTANT called, for example, CACHE_DIR:

define('CACHE_DIR', '../../public');

and use this constant into "functions.php", "footer.php", "cache.php", "common.php" where "cache" directory are called...

In Italy thousand people who use www.aruba.it as provider/mantainer can't use PunBB!!!

Max

I had this probleme too when I tried to install punBB. nothing complicated here.

I guess you're site is hosted, isn't it? Mine is, so all of my DBs get a prefix, I have no choice. let me explain :

I created a DB called punBB for the forums.

My host automatically renamed it cyrilg38_punbb as I'm under shared hosting

So I had to name my DB cyrilg38_punbb on the install page.

Hope this help

Re: Define a "cache directory" constant

thats a different problem, hes having a problem with his cache files not his database

Re: Define a "cache directory" constant

I had the exact same message when I installed...

Re: Define a "cache directory" constant

maybe but he said what his error is and has fixed it so it is not what you said tongue

Re: Define a "cache directory" constant

yeah right great master tongue