Codeigniter - setting up directories and files permissions (chmod settings) Codeigniter - setting up directories and files permissions (chmod settings) codeigniter codeigniter

Codeigniter - setting up directories and files permissions (chmod settings)


You want to:

chmod -R 0644 application system index.php

Assuming that CI is installed in the web root, with the application/ and system/ directories residing therein, which is the default setup.

What I typically do is put the application/ and system/ directories outside of the web root when I use Codeigniter, at which point you need to edit your index.php file to reflect that:

$system_path = '../system';$application_folder = '../application';

Note, you'd be adding the ../ (and also need to move those directories one level down) but I digress. The permissions for each directory should be 0755 and for each .php file 0644, wherever you end up putting them. This includes any vendor, 3rdparty, sparks, etc, and any custom asset locations.

If using a templating engine of some sort, good setups will work with 0755 folder permissions at the location where the engine writes its output and intermediate output if applicable. If you find that breaking, find a host that supports suexec so that you don't have to make those locations 777 (or world writeable).

This is most easily done using a terminal (SSH), but should also be easily possible with whatever file manager thingadongdong your host provides.


change the permission of your codeigniter folder with this command:

$ sudo chmod -R 755 /var/www/html/Codeigniter_folder_name