Why am I getting a 403 Forbidden error using codeigniter locally?
As mentioned in the comments you shouldn't be trying to directly access the .php
file your controller resides in. Direct script access isn't allow which is why you are getting the 403. You need to send request through your index.php
. So rather than using this URL
localhost/intranet/CodeIgniter_2.1.4/application/controllers/welcome.php
You need to use
localhost/intranet/CodeIgniter_2.1.4/welcome //Use this if your .htaccess removes index.phplocalhost/intranet/CodeIgniter_2.1.4/index.php/welcome
Or to access your login form
localhost/intranet/CodeIgniter_2.1.4/welcome/login_form //Use this if your .htaccess removes index.phplocalhost/intranet/CodeIgniter_2.1.4/index.php/welcome/login_form
If there are htaccess files change denied to granted or just remove them entirely
This happened to me. And i couldn't solve it with above answers.
I tried to change the folder CodeIgniter-3.1.4 Access (Others) to Access files and now i can see the index.php file.
I haven't tried anything more. Hope it helps.