blog icon

Setting up a Codeigniter project

codeigniter_logo

  1. Ok, first of all, download CodeIgniter, extract the package and put the folder contents inside your website’s folder.
  2. Go to your browser and type your website’s URL. You should now see the CodeIgniter’s welcome page.
  3. At this point, you may have (or not) set the database for the website you will develop. If you haven’t created it yet, do it now so we can continue with setting CodeIgniter.
  4. Go to CodeIgniter’s system folder “/Application/config/” and open the file “database.php”. In this file you should fill the database fields with the appropriate data (hostname, username, password, database)
  5. Still inside the config folder, open “config.php” and change the base_url variable with your project’s absolute path. Normally this will be something like “http://www.youdomain.com”.
  6. Now… move the “application” folder outside the “system” folder. Why? In the future you probaby will want to update CodeIgniter. When this happens you only have to change the “system” folder’s files without worrying about you project’s files inside the “application” folder.
  7. Now lets rename the “system” folder so you can always know which CodeIgniter version ou are using. Rename it to something like “sys_631″ (sys = system, 631 = version 6.3.1).
  8. Because you rename the “system” folder, you have to tell CodeIgniter the new name. Open the file “index.php” and provide the variable “$system_folder” with the new name.
    If you want you can apply the same procedure to the “application” folder (rename it) and then change the variable $application_folder here too.
  9. One last thing that I always do before starting a project. Autoload the “database” library and “url” helper in the “autoload.php” file that’s inside the “config” folder.

That’s it! You can start coding

Filed under: Blog, Tutorials

Comments are closed.