Codeigniter Installation In Xampp

In this tutorial, I am going to download and install Codeigniter in xampp. We will explain how to install Codeigniter on xampp server. So you can follow the next step to install or configure Codeigniter. Xampp and Codeigniter Setup: First thing we are going to do is setup Xampp for those who want to use codeigniter with xampp. So go ahead and download either portable version or developer version of xampp. Install it in the directory (and drive) as per your choice. Once you copy all the files of xampp in directory, find the start.bat file to. Install XAMPP or WAMP; Download and Unzip the package from Codeigniter.com; Extract all the document in the server space (htdocs or www directory) Mac Environment. Install MAMP; Download and Unzip the package from Codeigniter.com; Extract all the document in the server space (htdocs) Linux Environment. Download and Unzip the package from. Install CodeIgniter in XAMPP First download codeigniter latest version and extract its contents to the 'htdocs' folder of XAMPP. Rename the folder to some application name such as 'cidemo'. Codeigniter Install. Codeigniter Install: Steps to install Codeigniter. Unzip it at your server in folder “codeigniter”. For example: xampp/htaccess.

  1. Download Codeigniter 4
  2. Php Codeigniter
  3. Codeigniter Installation In Xampp Free
  4. Codeigniter How To Install
  5. Codeigniter Xampp Tutorial

Database migration is one of the best features that you get in any PHP framework. Database migration in the framework is just like a version control of your database tables. And another feature of migration is that you don’t have to send or put separate database file to other developers.

Codeigniter also comes with builtin migration feature and we are going to learn how to steup and run database migration

First let’s have a fresh copy of codeigniter from its site. You are unfamiliar with codigniter installation, no worries you can check my post how to install codeigniter in XAMPP.

Enable Migration:

By default migration is disabled in codeigniter. You have to enable it by going to config/migration.php and $config['migration_enabled'] to TRUE

Create Migration Folder:

Next thing is to create a migrations folder in the application folder. Remember name of the folder must be in plural no singular.

Ways to create Migration File(s):

Codeigniter xampp object not found

There are 2 ways to create a migration file. Means name of the file should be in following 2 ways.

  1. Sequential: Migration file name should start with 001. Each number should start with 3 digits and there must not be any gaps in the sequence.
  2. Timestamp: Each migration is numbered using the timestamp and format must be YYYYMMDDHHIISS (e.g. 20181208100537)

By default, timestamp is set to migration type. But you can change this by going to config/migration.php file and set $config['migration_type'] value from timestamp to sequential

Codeigniter

In this tutorial, I will be using a sequential type.

Create Migration File:

Migration file must extend CI_Migration class and class will have 2 functions. One is up() and second is down(). Up function will have table creation code and down function will get drop table code. $this->dbforge is a database manage class which will take care of database. You can visit Database Forge Class for further digging.

Now let’s create a migration for users table. I am creating a file in application/migrations folder as 001_Users.php

Download Codeigniter 4

After creating 001_Users.php goto config/migration.php and set $config['migration_version'] value to 1 and $config['migration_auto_latest'] to TRUE

2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
<?php
$this->dbforge->add_field(array(
'type'=>'INT',
'unsigned'=>TRUE,
),
'email'=>array(
'constraint'=>90,
'type'=>'VARCHAR',
),
'first_name'=>array(
'constraint'=>90,
'type'=>'VARCHAR',
),
'last_name'=>array(
'constraint'=>90,
'type'=>'VARCHAR',
),
'is_active'=>array(
'constraint'=>1,
'type'=>'DATETIME',
$this->dbforge->create_table('users');
$this->dbforge->drop_table('users');

Run Migrations:

Php Codeigniter

Now create a migration controller in controllers folder. I will create Migration.php and write below code.

2
4
6
8
10
12
14
16
18
20
22
24
<?php
defined('BASEPATH')ORexit('No direct script access allowed');
classMigrationextendsCI_Controller{
function__construct()
parent::__construct();
}
publicfunctionindex()
{
}
echo'Done';
}

Before running migration make sure you have already setup your database in config/database.php file. Now go to browser and type localhost/your_project/migration/index. If all goes well, migrations and users table will create in database.

More from WDB24.com

Codeigniter Installation In Xampp Free

Codeigniter Install : Steps to install Codeigniter.

Step by Step Codeigniter Installation Process

1. Download Latest Version 3.0.0 : Download Zip
2. Unzip it at your server in folder “codeigniter”. for example : xampp/htaccess/codeigniter

Codeigniter How To Install

3. Now go to – application/config/config.php Here add base url ie. Base path of your application directory.

For example :

Codeigniter Xampp Tutorial

War thunder m4a5. 4. Now to go the : application/config/database.php Add database settings here :

For Example :

5 . (Optional) : Remove Index.php from url

Create a .htaccess file at the root of the application for example at : xampp/htaccess/codeigniter – add here .htaccess file

Add the following code in the .htaccess file :

6. You are done : Now your application is ready : Hit the url : http://localhost/codeigniter you will see default welcome message