To download and install codeigniter 4; In this article, we would love to share with you how to install & download Codeigniter 4 project using the composer, GitHub, and manually and start the downloaded project.
Table of Contents
- Download and Install Composer
- Check Composer
- Download and Install Codeigniter 4 via Composer, Github, Manually
- Run CodeIgniter Application
1. Download and Install Composer
Go to the browser and hit the following URL in your browser https://getcomposer.org/download/. And double click on the downloaded composer exe file to setup the installation.
2. Check Composer
To check composer version, Simply open the command prompt or terminal and type composer -v command into it:
composer -v
3. Download and Install Codeigniter 4 via Composer, Github, Manually
Here are 3 options to download and install Codeigniter 4.
Option 1: Install or download Codeigniter 4 Manullay
Go to Codeigniter’s official website and download and extract Codeigniter’s new setup and your local webserver environment.
Option 2: Install or download Codeigniter 4 via Composer
In this step, you need to open your command prompt and run the following command for creating a Codeigniter project name “first-CodeIgniter-4”.
composer create-project codeigniter4/appstarter first-CodeIgniter-4 -s rc
Now, We will update dependency using below command. Whenever there is a new release, then from the command line in your project root:
composer update
Option 3: Install or download Codeigniter 4 via Github
In the third step, you can download or install the codeigniter 4 using git.
git remote add upstream https://github.com/codeigniter4/CodeIgniter4.git
4. Run CodeIgniter Application
Next, we will run the download project, let’s open the terminal so go to
cd C:\Xampp\htdocs\first-CodeIgniter-4
Run the following command
php spark serve OR php spark serve --port=8081 OR php -S localhost:3000
After run the above command, go to browser and hit url http://localhost:8000/ or http://localhost:8081/ or http://localhost:3000/
Conclusion
In this Codeigniter 4 tutorial – we have successfully installed or download the CodeIgniter project using the composer, git and manual.
I’m running on windows 11 home and needed to run on port 8081. The command, php spark serve –port=8081, did not work for me. I had to use the command, php spark serve —port 8081.