How to Install CodeIgniter in Xampp and Wamp
Hello Readers,
I would like to guide about installing CodeIgniter and how to display basic “Hello World!” message.
First step is to Download CodeIgniter recent version from the official website. – http://ellislab.com/codeigniter/user-guide/installation/downloads.html.
You will get a zip file. Extract the zip file into a new folder and name it as you wish, lets say exercise.
Then move the exercise folder into the local server. If you use xampp, move the exercise folder into xampp/htdocs/
and if you are using wampp, move it to wampp/www/.
That makes the installation part over.
Now let me explain the structure of the CodeIgniter. You can see the three folders named application,system,user_guide. Application folder contains most of our project files. In my previous post, I mentioned CodeIgniter follows MVC pattern. How it actually does that is, it seperates the files in three different folders.
In Application folder,
Controller – contains the Controlling operations of Project
Model – contains the database operations
View – contains the HTML parts.
We can pass the data from Controller to Model and vice versa.
We can pass the data to be displayed into the View from Controller.
Working on CodeIgniter:
After the successful installation, explore to exercise/application/config/config.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://example.com/ | | If this is not set then CodeIgniter will guess the protocol, domain and | path to your installation. | */ $config['base_url'] = ''; /* |--------------------------------------------------------------------------
Change the $config[‘base_url’] = ‘http://localhost/exercise’; or the folder name you have chosen earlier. Then open your browser and enter http://localhost/exercise, You can see a welcome message on the screen.
Read my next post about, Database Connectivity in CodeIgniter.
Thanks for reading.
Related Posts
Nagarajan
View Nagarajan's Profile
Latest posts by Nagarajan (see all)
- Random Image viewer using AngularJS - June 30, 2016
- Building your first AngularJS app – Shopping list - June 22, 2016
- How to use Cookies in AngularJS - October 20, 2015
Hi there,
Nice tut on howto start with codeigniter. My experience with the base config is that you can leave this blank. Codeigniter will find this in 99% of the time by it self.
Happy coding from her….
Regards,
Brian
Thank you Brian. Its good to see a note from you. But its good to config base url at many cases. Thanks for reading.
Do you have tut on how to installing codeigniter and how to display basic “Hello World!” message using Linux Mint 16 Petra? I switch from windows to linux os.
Hello Allan,
Installation procedure is same for “Linux Mint 16 Petra”. Download CodeIgniter and extract the folder to xampp server. Then, change the $config[‘base_url’] = ”; value would be http://localhost/%5Byour-codeigniter-folder-name%5D in xampp/htdocs/[your-codeigniter-folder-name]/application/config/config.php. CodeIgniter is ready to use now. Enter http://localhost/%5Byour-codeigniter-folder-name%5D in the browser. You can see a welcome message.
Hope this helps.
Wow! It was so easy, I will follow the others tutos.
Best regards!