Skip to content Skip to sidebar Skip to footer

3 Ways to Install Codeigniter on Windows (Complete+Pictures)

How to install CodeIgniter on windows via Composer and how to solve errors that may occur when installing the CodeIgniter framework.

Codeigniter is a very powerful php framework, but it is quite light, simple, and easy to learn. Codeigniter itself uses the MVC pattern, namely Model, View, Controller where you can separate the logic and appearance of the website that you will build with this MVC framework.

However, before you install and use Codeigniter. According to the official codeigniter site documentation, CI4 requires PHP specifications >= 7.2. If you are still using PHP version < 7.2, it is recommended to update first.

And also there are some requirements needed when installing Codeigniter 4, namely:

  • intl extension
  • mbstring extension.
  • php-json
  • php-mysqlnd
  • php-xml

For those of you Windows users, you can directly open the file php.ini on XAMPP then uncomment for the extension above (will also be discussed in the middle of the tutorial).

1. Download Codeigniter4 from the Official Website

1. First, please visit the official Codeigniter website here and please download. As shown in the image below. Previously make sure the PHP version on your PC or laptop is 7.2 or above. If not, please update first.

PHP version on PC or laptop

2. Please wait a few moments until the download is complete.

3. When you’re done, you’ll get a .zip file. Please extract it first.

4. If you have extracted it, please rename the file name to ci4 or according to your wishes. As in the image below.

how to install codeigiter on windows 10

5. Then, please move the folder into htdocs. As in the image below. Here I use XAMPP, if you don’t use XAMPP please adjust it.

using XAMPP

6. Done.

2. Install Through Composer

1. First, please open CMD or Command Prompt on your PC or laptop. As in the image below.

how to install codeigiter framework

2. Then, please type the command as below

composer create-project codeigniter4/appstarter project-root// thencd project-root// thencomposer update 

3. If it’s finished, please try running it. There are two options to run it.

    • The first option, please open a browser on your PC or laptop. Then type
      localhost/ci4

      Then, please click Public. As shown in the image below.
      click Public
      And if your codeigniter is successful the results will look like the image below.

    • codeigniter
    • Then the second option is for you to open a terminal and type:
      php spark serve
      As in the image below. Don’t forget you have to be in the codeigniter folder beforehand.
      Then, please open the browser and type
      localhost:8080

      And if successful, it will look like the image below.

    • how to install codeigiter

4. Done.

3. Overcoming Errors When Installing Composer

When downloading Codeigniter 4 directly on the official website or via composer, and running it with php spark serve sometimes appears ext-intl error like the picture below.

Then, how to solve it?

1. How to solve ext-intl error in Windows:

1. First, please open XAMPP-Control. Then, please click config on the Apache section. As in the image below.

how to install codeigiter

2. Then, please click PHP (php.ini). As in the image below.

how to install codeigiter

3. Then, please Uncomment on extension extension=intl. Please remove the “semicolon” in front of it. As in the image below.

how to install codeigiter

4. Then, please restart the webserver you are using.

2. How to solve ext-intl error on Linux:

  1. Please open the terminal.
  2. Then, please type sudo apt install php-intl
  3. And restart the web server that you are using.

3. How to solve ext-intl errors on Mac:

  1. For mac, you can use brew
  2. Please type brew install php70-intl
  3. Then, adjust to the php version you have, please check the php version you are using with php -v
  4. Then type brew install php71-intl for php 7.1
  5. Then, brew install php72-intl for php 7.2
  6. Then, brew install php73-intl for php 7.3
  7. And, brew install php74-intl for php 7.4

So this article discusses how to install Codeigniter on a PC or laptop. Hopefully this article can be useful and help you. Thank you

Post a Comment for "3 Ways to Install Codeigniter on Windows (Complete+Pictures)"