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:

  1. Create a new sub domain through MAMP. It should be possible to the same through other local development tools too.
  2. Drop in the framework files, plus a standard .htaccess file so that you can use pretty url’s.
  3. Update the config/config.php file with the basic site settings, remembering to remove index.php from $config['index_page'].
  4. 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.
  5. Set up your database in config/database.php
  6. 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: ,

One Response to “How to Install CodeIgniter”


Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Most Valued Blogger - DZone

 

February 2012
M T W T F S S
« Jan    
 12345
6789101112
13141516171819
20212223242526
272829  

Random Quote

Broadly speaking, the short words are the best, and the old words best of all. — Sir Winston Churchill

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Categories

Follow Me