In this tutorial, we are going to install CodeIgniter 3 on our system. This tutorial will help you to install CodeIgniter on Ubuntu 18.04 Bionic LTS systems.

Step 1 – Prerequsities

Login to your Ubuntu system. CodeIgniter framework required PHP to be installed, MySQL as the database server and Apache/Nginx as the webserver. Use one the following tutorial to install LAMP server on your system

Install LAMP on Ubuntu 18.04

Step 2 – Download CodeIgniter

Download the latest version of CodeIgniter from its official GitHub release page. You can use following commands to download CodeIgniter 3.1.9 on your system. Extract the archive on your local system and place directory for document root with proper naming.

Step 3 – Create Database

Now, create a database for your CodeIgniter application in MySQL. I have MySQL 5.7 running on my machine. Connected to MySQL with root user then create database and user with the below queries.

Ater creating database, edit the CodeIgniter database configuration in text editor and update the database settings as per your environments.

Step 4 – Setup CodeIgniter

Now you need to configure the base URL for your application. For this tutorial, I am using the www.example.com domain for configuration. You can choose the localhost or any valid domain name of your choice. Edit config.php file in text editor: and update base_url as following:

Step 5 – Setup Apache for CodeIgniter

For this tutorial, I’m using Apache web server on my Ubuntu system. Create a new VirtualHost configuration file: Add following content with proper server name, alias:

Save the Apache VirtualHost configuration file. Now use the a2enmod command to enable newly created CodeIgniter VirtualHost. Also, restart the Apache service to apply changes.

Step 6 – Testing

All done. You can access your CodeIgnator application in your favorite web browser with the configured domain name. By default, you will the screen below.

Let’s start developing with CodeIgniter.

How to Install CodeIgniter on Ubuntu 18 04  Bionic    TecAdmin - 46