Click here to Skip to main content
12,754,090 members (28,425 online)

Code Igniter with WAMP Server to run PHP application

wayten asked:

Open original thread

I have been unsuccessful with getting a static .php page to run on my local wamp server.

Here are my steps according to code igniter:
1. Unzip the package.
2. Copy the CodeIgniter folders and files to my local server directory
3. Go into the application folder of code igniter ( application/config/config.php)and set my base url to using notepad++

4. I create a file named pages.php at application/controllers/pages.php in the code igniter folder with the following code
             class Pages extends CI_Controller {

    public function view($page = 'home')
      if (!file_exists('application/views/pages/'.$page.'.php'))

         //Whoops, we don't have a page for that!


      $data['title] = ucfirst($page); //Capitalize the first letter
      $this->load->view('templates/header', $data);
      $this->load->view('pages/'.$page, $data);
      $this->load->view('templates/footer', $data);


5. I create a header.php file in the code igniter folder at application/views/templates/header.php with following code:

	<title><?php echo $title ?> - CodeIgniter 2 Tutorial</title>
	<h1>CodeIgniter 2 Tutorial</h1>

6. Create the footer in the same template folder located in the code igniter folder at application/views/templates/footer.php
© 2011	

7. I entered in my web address: to see a page I created called home.php.
I got a message which says access is forbidden. Error 403.

What is I have done wrong in setting up Code Igniter so that when I create my .php file in the view I'm able to enter the url to access it.

Any help would be much appreciated. Thanks much.

Tags: PHP


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100