Welcome Guest, Not a member yet? Register   Sign In
CodeInigter 4 - 403 Forbidden
#1

I just downloaded CodeIgniter 4.0.2, extracted the zip file, renamed the folder to ci4

Tried to access localhost/ci4/  and I'm getting a 403 error.

What am I doing wrong? I didn't do anything else
Reply
#2

Recommend you to read this and follow instructions there: https://codeigniter4.github.io/userguide...index.html

It will not work if you just download it, unpack and rename. Probably, you should at least run webserver (built in spark, or external one like Apache). Please read this: https://codeigniter4.github.io/userguide...nning.html

Otherwise it is not possible to help you, because in your question you do not give any hint anout your system: Windows, Linux or Mac, local or cloud, what is your webserver and PHP version (if installed at all), etc.
Reply
#3

(02-26-2020, 11:16 AM)zahhar Wrote: It will not work if you just download it, unpack and rename. Probably, you should at least run webserver

Thank you for helping, I have pretty much everything setup under the Apache section

I'm deploying it on Linux, using Dockerized Apache and PHP 7.4.2

If I download CI3 from the website, unzip and place it on my Docker volume path, it runs, but when I do the exact same thing for CI4 it redirects me to 403 Forbidden

I already edited the baseURL

Any other ideas? I just want to see the default CI4 home page
Reply
#4

Did you set your document root to "xxxxxx/xxxxx/public"?
Simpler is always better
Reply
#5

How about chmod for index.php, is it executable?
Reply
#6

Hello geem !

1/ To load CI3, you go to the root folder. To load CI4, you need to go to the "public" folder. So `localhost/ci4/public" instead.
2/ As CI3 is working for you, the error 403 probably means permissions issues with Apache. Probably due to point 1/
Reply
#7

CI4's document folder is under "/public".

You should set your document root to:

localhost/ci4/public
Reply
#8

@gem.

Did you make the writable folder writable?

chmod -R 0777 CodeIgniter4/writable

If that still does not show the Welcome page then try adding the following to the top of the iCodeIgniiter4/public/ndex.php file.

Code:
<?php
define('CI_DEBUG', FALSE); // bypass (bool) app/Config/Boot/development.php

If that works then remove changes and try to understand why it is not working Smile
Reply
#9

don't forget to add DECLARE(STRICT_TYPES=1);
to every single php page.
Reply
#10

(03-02-2020, 03:54 PM)tweenietomatoes Wrote: don't forget to add DECLARE(STRICT_TYPES=1);
to every single php page.

No! This has nothing to do with the 403 error.
Geem just need to fix the original installation problem.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB