Setting up the CI framework on your web server is easy. CodeIgniter is very flexible. It will work equally well with PHP 4.3.2 and above, or PHP 5.

You will also need a database. CI’s online user guide says: “Supported databases are MySQL, MySQLi, MS SQL, Postgre, Oracle, SQLite, and ODBC.” In order to develop and test a dynamic website, you need a web server. Normally, you would develop and test your site on a local server, i.e., one that runs on your own machine (with the loopback address 127.0.0.1 or localhost).

If you aren’t familiar with the process of setting up a web server, it’s easiest to install a package such as Xampp, which installs Apache, PHP, and MySQL on to a Windows machine with minimum configuration by you. Xampp is free, comes with comprehensive instructions, and is almost always easy to install. Alternatively, some versions of Windows come with their own web server.

smart-database-driven-routing-in-codeigniter

Installing CodeIgniter

Once your server is set up, go to the CodeIgniter site at http://www.codeigniter.com/ and download the latest version of the framework. Version 2.2, the latest, is only 2.21 Mb when zipped, so the download doesn’t take that long Unzip the folder, and install the CodeIgniter files in your web root folder. If you are using Xampp, this is usually the htdocs folder within the Xampp folder.
The CodeIgniter index.php file should be in the root directory. The root folder is the folder that you would point at if you navigated to the site—in this case, by accessing http://127.0.0.1. Of the two minutes we need to set up the site, one minute is up!
Included with CI is a comprehensive user guide (in the user_guide folder). You’ll use this a lot. It is usually clear, and often goes into more detail.
When these files are on your machine, you can access them in two ways:

As a URL—e.g., http://127.0.0.1

Through the normal directory path: e.g.,

C:/xampp/htdocs/index.php

You should be able to see the CI welcome screen by simply navigating to your URL with the browser. It’s that simple! The welcome page tells you that what you are seeing is built by two files, a view and a controller.