2

Setting up a Development Server

You may be intending to use some php enable hosting to follow through this tutorial, personally I prefer to use a server set up on my local machine. This section will explain how to do this. If you already have one set up, or intend to use live hosting then feel free to skip to the next section.

Pre Packaged Servers

Setting up a server for development purposes is not that difficult, but due to the variety of platforms and machine setups out there any it would probably require a tutorial all of its own. For this reason I recommend using one of the "Pre Packaged" Apache, PHP, MySQL developmnent servers available.

PC users need to download and install WAMP, MAC users need MAMP. Both have free versions and require a one-click install. On installation you will be taken to your MAMP/WAMP homepage. This is a php page produced by the server you have just installed. Easy, wasn't it.

MAC USERS: if you have installed MAMP it is likely that the url you are looking at will begin something like this: http://localhost:8888/ - the '8888' is the port that MAMP uses and all of your urls must contain this, I will NOT always use it in my examples but just remember that you need it.

So where are all the files and things?

Again, there are two different setups for PC and MAC, if you have installed WAMP and used the default settings the folder that contains your web files (the DOCUMENT ROOT) would be C:/wamp/www/ if you chose something else during installation, then it will be whatever you chose. MAC users, your DOCUMENT ROOT will be in /Applications/MAMP/htdocs - this folder is probably empty, this is because MAMP is currently using some 'magic' to display its welcome page, don't worry about this right now.

Test the Server

We are going to create a php info file to make sure that files served from our DOCUMENT ROOT are "parsed", which sort of means 'activated', OK, so first, in a text editor create a file named info.php and into this file copy the following:

<?php phpinfo(); ?>

Save the file then open your browser and navigate to: PC user: http://localhost/info.php and MAC users: http://localhost:8888/info.php

On screen you should see a large table of information, this is all of the details about the version of php and other resources running on the server. If this is what you see then everything is working and you are ready to install CodeIgniter.

CodeIgniter walkthrough (index.php) »