How to Install CodeIgniter4Deepak Sharma
Codeigniter 4 is the lightweight framework of PHP with small footprints. There is not too much configuration required to run. It is not required to use the command line in Codeigniter.
- Php 7.2 (min)
- Extensions (*intl* extension,*mbstring* extension)
- Database – MySQL
- Localhost server (xampp, wamp, lamp)
Note: you can download any third-party application to create the localhost like xampp, wamp, lamp
Step 1. Download Codeigniter 4
Step 2. Extract the zip file in your localhost root directory.
Step 3. Open your project in your fav code editor. Here I have used VScode.
Project running successfully in chrome hit the URL http://localhost/C4/public/
Step 4. Now if you want to remove the public from the URL
- Copy the index.php and .htaccess file from the public folder and paste it outside the public folder.
- Open the index.php and change the below-given code
Replace the above line From below
- And press Ctrl+S to save the changes
- Now you can access the project without the public http://localhost/C4/
Step 5. Now create the below-given files in your project
Step 6. Configure the database into your project.
Read Also:- How To Install The Telescope In Laravel
Step 7. Setup the project env
Open .env and change the project environment
CI_ENVIRONMENT = development
Step 8. Add the given below code into respected files
Step 9. Finally, you have to make changes in routes.php
Change the below
Add the new route in routes.php for Home_cnt controller
Comment out the old routes for the Home controller