Andy Hawthorne
I write and I code.
How to Install CodeIgniter
When creating a new web app project where CodeIgniter is the framework behind it, there are some things that I do every time. These are the things that, once completed, give you a very basic working installation. A working example is available on Github.
Local Set Up
Since I’m on a Mac, I use MAMP Pro for local development. For Windows users, there is WAMP, and for Ubuntu Linux I have a guide here that shows you how to set up Apache,PHP and MySQL.
Getting CodeIgniter
You can download CodeIgniter from codeigniter.com. It is also available on Github.
Basic Installation
Here are the steps that I follow:
- Create a new sub domain through MAMP. It should be possible to the same through other local development tools too.
- Drop in the framework files, plus a standard .htaccess file so that you can use pretty url’s.
- Update the config/config.php file with the basic site settings, remembering to remove index.php from $config['index_page'].
- Add in the libraries and helpers that you use most commonly in config/autoload.php. I always autoload the database, session, and the email libraries. For helpers, I always add to add the url, date, and security ones.
- Set up your database in config/database.php
- test the new site in your browser. You should get the default Codeigniter welcome page.
Get the Code
I have a working example available on Github. It assumes: that you have a local domain set up called ci-basic.dev (change that in config/config.php with the $config['base_url'] parameter), that you have the .htaccess and Apache mod_rewrite working, and that you have a MySQL database called ci_basic set up with the credentials found in config/database.php. They can obviously be changed to suit your own setup.
So that is how I tend to begin a new CodeIgniter based web application. What do you do? Much the same? Or do you do something different? Feel free to comment below…
Tags: Codeigniter, installing

[...] You should read that one first, if you haven’t already. If you are new to CodeIgniter, then this article will help you get started with the [...]