mzcoxfde mzcoxfde - 1 year ago 162
PHP Question

CodeIgniter error 403 Access forbidden on Ubuntu

I've been working on not-much-complicated projects using CodeIgniter on windows, but this is my first time to launch any php file in Ubuntu.

I copied a CodeIgniter project to

which was working perfectly on windows but doesn't work on Ubuntu. It gave me the 403 error.


  1. Set permission from the command line:
    sudo chmod 777 -R /opt/lampp/htdocs

    sudo chmod 777 -R /opt/lampp/htdocs/ PROJECT_FOLDER

    where PROJECT_FOLDER is the name of your project directory.

  2. Make sure your controllers' name are capitalized.

Answer Source

In addition to the good comments, apache needs execute access on every folder from root to the project in order to traverse the file system.

sudo chmod +x /
sudo chmod +x /opt
sudo chmod +x /opt/lampp
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download