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.
- 1. Introduction
- 2. Setting up a development server
- 3. CodeIgniter walkthrough (index.php)
- 4. Editing and creating views
Pre-packaged development servers
If you are using a PC I recommend using WAMP, it has a 1-click install and keeps everything nice and tidy.
For MAC users I recommend MAMP, for the same reasons. Both are free to use
Where to put web files
Assuming you have installed WAMP or MAMP
PC: c:/wamp/www/
MAC: /Applications/MAMP/htdocsWhat is a DOCUMENT ROOT
This is just the folder that the server serves pages from, if oyu have used a shared hosting account it may have been called httpd, htdocs, home, www or something similar.