Installing CodeIgniter

As we know that “CodeIgniter is an application development framework, which can be used to develop websites, using PHP. It is an Open Source framework. It has a very rich set of functionality, which will increase the speed of website development work.”

So today we will learn how to “Install CodeIgniter”. Follow the steps given bellow to install CodeIgniter on the server:

Step 1

First of all you have to download the CodeIgniter setup folder. This is available on the official website of CodeIgniter itself. You can use the following link to download the zip folder.

Go to Download site

Note : There will be two versions of CodeIgniter. One is “CodeIgniter 2.X” and other is “CodeIgniter 3.X”. You can download and use any of these. But as per our recommendations, you should go ahead with the latest version of CodeIgniter as there are some new features for security. Don’t worry, “CodeIgniter 2.X” is also secure enough.

Step 2

Now you have a zip file. Unzip the folder. Now Upload all files and folders to your server.

Note: If you are trying to install CodeIgniter on your system localhost then copy the unzipped folder to

var/www/html/

(If you are using ubuntu)

wamp/www/

(If you are using Windows)

Step 3

Now rename the folder to “my_ci_project”. You can name it anything. Upto this, your folder is ready to let you into the codeIgniter world.

Step 4 (Configuration)

Now you have to configure your setup to make it running well on your server. The application/config folder contains a group of files that set basic configuration of your site. Now we will talk about those files and will make the changes according to requirement.

Step 5 (Configuring Base URL)

To configure base URL, go to application/config/config.php file. Before we go ahead, let have a rough idea about what is base url in codeIgniter.

“Base url is the URL of our website on the server”.

For better understanding, lets say, we want to install the codeIgniter on the server https://tutsocean.com then our code inconfig.php file will be as follows:

If you are installing it on your local machine then the code will be:

Note : I have used the name “my_ci_project” here in the url because my project folder name is “my_ci_project”.

This is all you need to change in the config.php file.

Step 6 ( Configuring Database )

We are assuming that you have already made a database in phpmyadmin. IF you are done with that then go ahead to this step. If you still have not made the database then make one database in phpmyadmin.

If you don’t know how to make database in phpmyadmin then click here to have a compete tutorial on how to make database in phpmyadmin

Now to make changes to the database configuration, go to “application/database.php” file and make the following highlighted changes in the code:

Here database_name will be replaced with the name of your database.

  • hostname − Specify location of your database here e.g. localhost or IP address
  • username − Set username of your database here.
  • password − Set password of your database here.
  • database − Set name of the database here.

Now put the following code into your file so that your default environment will be set to default

Step 7 ( Running the project )

To check that whether you setup the codeigniter properly, you have to run the project on the browser. Copy and paste the following code into address bar of browser and hit enter

You will see the following output on the screen.

codeigniter welcome View
codeigniter welcome View

That is all you need to configure the codeIgniter on your server. IF you have any queries, you can ask your queries in the forum section. Experts from over the world will answer the question. Here is the link Forum section