Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+8 votes
364 views
in Q2A Core by
edited by

My q2a is installed on a subdirectory folder ask, i am using hostinger. Showing this error on cache setup, How to fix this?

The directory home/public_html/ask/cache/ defined as QA_CACHE_DIRECTORY is not writable by the web server.

i have setup the folder to 777

COde in qa-config.php

define('QA_CACHE_DIRECTORY', 'home/public_html/ask/cache/');

Q2A version: Version 1.8.6

1 Answer

+1 vote
by

Making a webserver directory world-writable (777 permissions) is a bad idea. Never do that unless you know exactly what you need it for.

Change owner and group of the cache directory to the webserver user and group (on Debian systems that'd be "www-data" and "www-data") and change the permissions to 750.

With that said, the problem is most likely that the webserver user cannot traverse one of the ancestor directories. Check the permissions of all directories in the full path to home/public_html/ask/cache and make sure the webserver user has at least "x" permissions to all of them.

If you can use POSIX ACLs you can fix missing permissions by adding an ACL granting the user "x" access, otherwise grant "o+x" to directories where the webserver user doesn't have access by ownership or group.

...