Install CodeIgniter 4

Codeigniter 4 alpha has been released to the public for review so here is a quick run down on how to get started. Please note this is not even close to being production ready so please don’t create any public facing websites, this code is for review only.

Codeigniter brings some huge changes to the framework moving away from everything I hated about CI3 and bringing in a lot of features I love about other frameworks. I will be writing up an in depth review in the coming weeks but for now here is how you can get started looking at the CI4 source code.

First clone the GIT repo locally.

git clone https://github.com/bcit-ci/CodeIgniter4.git ci4

Once the repo has been cloned change directory into the cloned folder.

cd ci4

Here you can now see the new folder structure of the a CI4 application. I will run over the full folder structure in a later blog post but for now the main two folders you want to take a look at are your public folder and the app folder.

The app folder is the new home for all your controllers, configurations, models, views and the codeigniter helpers and libraries.

Index.php has now been moved, like most other frameworks, to the public directory.

Lets start a local server, change directory into your public folder.

cd public

Now from the pubic folder you can start serving your new codeigniter app.

 php -S localhost:8080

You can now view the application at:

http://localhost:8080

This should hopefully get you up and running quickly with CI4 and give you a good overview of the things to come, a lot of changes are still planned on the roadmap so these are exciting times ahead.

I’m keeping a close eye on this one and could be persuaded to move back to codeigniter if they can pull this off.

Leave a Reply

Your email address will not be published. Required fields are marked *