Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.3k views
in Q2A Core by
When enabling cache in 1.8
How to solve?
Q2A version: 1.8

1 Answer

+2 votes
by

See the comment in qa-config.php (or qa-config-example.php), you need to define QA_CACHE_DIRECTORY in your config. Currently the folder needs to be outside the public root (in other words so it cannot be accessed in a web browser via example.com/cache/...).

Something like this in your qa-config.php should work:

define('QA_CACHE_DIRECTORY', __DIR__.'/../cache/');

Then that folder should be made writable by the server (chmod 777).

by
But when I am making folder outside public_html
And putting path in config file

define('QA_CACHE_DIRECTORY', '/storage/ssd5/513/2620513/qa-cache');

I also tried /qa-cache

Is this wrong?
by
I did everything like you told and tried all paths

Is this not working because I'm using cloudflare?
by
edited by
I also tried define('QA_CACHE_DIRECTORY', __DIR__.'/storage/ssd5/513/2620513/qa-cache/');

I also made folder 777
by
Cloudflare shouldn't make any difference, this is all stuff that happens on your server that doesn't go to Cloudflare.

The folder needs to be the full path on the server to the cache folder. So if your site lives in '/storage/ssd5/513/2620513/public_html/' then you'll need to use '/storage/ssd5/513/2620513/qa-cache/'
You can get the full path from the variable $_SERVER['DOCUMENT_ROOT']
You could try this as your directory:
    $_SERVER['DOCUMENT_ROOT'] . '/../qa-cache/'
by
$_SERVER['DOCUMENT_ROOT'] . '/../qa-cache/'

Where to try this?
by
*/

define('QA_CACHE_DIRECTORY', '/storage/ssd5/513/2620513/qa-cache');

/*

This works.. I was doing  before */ that's why the problem.
...