The start to *baking is to download the latest build of the platform. The one I’m using today is 1.2.0.6311 and it is downloaded from the downloads page on the CakePHP website. The file name I grabbed is cake_1.2.0.6311-beta.zip

As my platform is Windows XP, I have a My Documents folder which I refer to as MyDocs, which if not managed with a few sub-folders it can be a dumping ground, where it is hard to find anything. All my code downloads go into MyDocs under a folder called Code. There is a sub-folder called Cake, into which I dump the zipped files of the latest version. That way, when I back up things on the laptop, I might just grab the whole MyDocs folder, or just the Code folder, and everything in it.

Looks a bit like this:

 MyDocs
   ...
   Code
     ...
     ASP
     Cake
       ...
       cake_1.2.0.6311-beta.zip
       ...
     C#
     HTML
     PHP
     ...
   ...

When I open the zip file I am going to be asked where to extract the files to. I am using the free Apache webserver on my laptop, it lives at c:\apache224, so the structure looks like so:

 /
   ...
   Apache224 - this is the folder that contains
               my local Apache webserver
               for development and testing
               (version 224 by the looks of it)
     bin
     cgi-bin
     conf
     error
     htdocs  - this is the folder http://localhost lists
               when entered into a browser
               and also the folder I grab for backups
               of all my web work
       ...
       aa01 -  my various web projects below here
       ...
       cake12
       ...
       project01
       project53
       projectxyz
       ...
       phpinfo.php
       ...
     icons
     logs
     manual
     modules
   ...

Where I put the files is under the htdocs folders in a folder called \cake12. In Apache I have turned off the default auto open feature of index.php so I can see a listing of all my web projects when I type http://localhost into the browser address bar. This is my development machine, not a live public web server, so I want to see all my projects listed.

Some might disagree how I structure my folders. I like it this way, projects are totally separate from the \cake12 folder because when I test publish a project to the live web site, I only want to upload changes from the project folder. When developing and testing, the project files get changed often.

The core cake12 files only get loaded to the live site by me when a new build is released by CakePHP and I actually download it. The core files are in a different folder under htdocs, on both the local and the live websites, so that the files can be easily changed in their respective, but separate, folders. Each site closely mirrors the other – easier to follow – the only thing that changes is the domain name. Either locally I enter say http://localhost/index.php or on the live site I use http://mydomain.com/index.php.

The folder I am going to use for my project is \aa01. It is named with a leading ‘aa’ to present at the top of the list. This folder will be created automatically during the bake project process in the next post.
Note that I also have the file phpinfo.php in the root of my local website – there have been a fair few number of times I have had to open this file locally to check some info about my webserver settings. Do NOT put this file on the live website, it might give a hacker too much info.Keeping it simple initially takes a little thought about the folder structure and it seems to work effectively in practice.

*Baking – writing code / developing an application to run on the CakePHP platform