Welcome Guest, Not a member yet? Register   Sign In
Correct permissions for Writable folder?
#1

Could somebody show me what permissions do I need to setup for Writable and it's sub folders?

I am getting this error

CodeIgniter\Cache\Exceptions\CacheException

Cache unable to write to /var/www/myproject/writable/cache/

I am on Ubuntu 18.04 using CI4 beta 1.
Reply
#2

(03-08-2019, 10:35 AM)happyape Wrote: Could somebody show me what permissions do I need to setup for Writable and it's sub folders?

I am getting this error

CodeIgniter\Cache\Exceptions\CacheException

Cache unable to write to /var/www/myproject/writable/cache/

I am on Ubuntu 18.04 using CI4 beta 1.

writable folder and child folders must be owned by web server process, in my Linux Centos is apache (production)
    chown -R apache /var/www/myproject/writable

Or allowing total control to everyone (development)
    chmod 777 -R /var/www/myproject/writable
Reply
#3

(03-08-2019, 12:26 PM)elephpantech Wrote:
(03-08-2019, 10:35 AM)happyape Wrote: Could somebody show me what permissions do I need to setup for Writable and it's sub folders?

I am getting this error

CodeIgniter\Cache\Exceptions\CacheException

Cache unable to write to /var/www/myproject/writable/cache/

I am on Ubuntu 18.04 using CI4 beta 1.

writable folder and child folders must be owned by web server process, in my Linux Centos is apache (production)
    chown -R apache /var/www/myproject/writable

Or allowing total control to everyone (development)
    chmod 777 -R /var/www/myproject/writable

As you are on Ubuntu, if you have root access you can set
 chown -R www-data:www-data var/www/myproject/writable
Reply
#4

Or 775 776
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(03-09-2019, 02:35 PM)InsiteFX Wrote: Or 775 776

Thanks
Reply
#6

(This post was last modified: 04-30-2020, 03:15 AM by krlwbstr.)

If your dir permissions are correctly set, worth taking a look at this as it could be to do with permissions of the httpd in SELinux.

This worked for me (Centos7):

A simple check to validate:
1) Create test.php in app root
<?php file_put_contents("/var/www/html/<codeigniterpath>/writable/test.txt", "test");

2) Execute it from command line. It should create the file with test inside.
Then delete test.txt.

3) Call from browser https://url/test.php

If it doesn't create, check /var/log/audit.log, look for "denied { write } " relating to the httpd/apache.
If you find these entries, then it might be to do with permissions for httpd in SELinux.

Try:
chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/<codeigniterpath>/writable/

or google "SELinux apache write permissions" for clues
Reply
#7

File permissions table:

The mode parameter consists of four numbers:

1) The first number is always zero
2) The second number specifies permissions for the owner
3) The third number specifies permissions for the owner's user group
4) The fourth number specifies permissions for everybody else
Possible values (to set multiple permissions, add up the following numbers):

1 = execute permissions
2 = write permissions
4 = read permissions
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB