Setting up first CodeIgniter project
PHP CodeIgniter

Setting up first CodeIgniter project

Mishel Shaji
Mishel Shaji

Setting up or configuring a CodeIgniter project is much easier compared to other PHP frameworks such as Laravel.

Setting up CodeIgniter

  • Download the latest version of CodeIgniter from this link.
  • Extract the downloaded file to the project folder.
  • Navigate to http://localhost/yourwebsite – you will see the default welcome page of Codeigniter.
  • Open the application/config/config.php file and set the base URL of your web application by modifying the line $config[‘base_url’] = ””; as shown below.

$config['base_url'] = 'http://localhost/name_of_your_site';

  • If you want to use database,  open database.php file located in application/config folder and specify the credentials in appropriate fields as shown below.
$db['default'] = array(
	'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_database',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE

You are done with setting up the project.

Here’s a video tutorial…