This is Part 1 of this tutorial, subsequent parts will be posted in this same thread.
This thread will remain
locked from comments until the tutorial is completed.
I'll be taking you through the whole process of the development of a cake application.
This application will have admin-managed users, file uploads, and a simple user activity log.
Additionally, this application will be accessible only to logged in users & administrators.
This assumes that you have a Linux hosting account with shell (SSH) access.
First, you need to download CakePHP to somewhere that can be accessed by your SSH/web user.
This location doesn't need to be web *visible* though.
I store mine in a directory outside of my document root (see below). Please be sure you extract the files of course

My environment:
Quote:
/home/webuser/ # my home directory
/home/webuser/lib/ # where I store common PHP files that don't need to be accessed directly via the web. ** This is where I store CakePHP, after it's been downloaded and extracted
/home/webuser/mydomain.com/ # this is the path to my domain's document root, so for example, index.php would go here
Download CakePHP.
Quote:
cd /home/webuser/lib/
wget
http://cakeforge.org/frs/download.php/7 ... n=completetar xzf cake_1.2.2.8120.tar.gz
rm -f cake_1.2.2.8120.tar.gz
So that I can "bake" a CakePHP application from command line, without having to constantly reference the full path to my cake installation, I add my CakePHP console directory to my PATH by issuing the following commands in SSH:
Quote:
PATH=/home/webuser/lib/cake_1.2.2.8120/cake/console/:$PATH
export PATH
If you'd like to ensure that path gets set every time you login to SSH, you can add those commands to your ~/.bash_profile
Now you can proceed to set up your application.
Quote:
cd /home/webuser/mydomain.com/
cake bake
At this point, you should see a prompt, asking you for the path that you want your application to exist in.
Assuming you want cake to be accessible at the root of your website, give it the full path to your document root.
Note: When cake is prompting you for your application path, it provides an example using path-to-this-directory/myapp. You can just copy that entire directory path, and strip off the /myapp bit.
After entering your document root and pressing enter, you'll be asked if it's okay for cake to copy in a "skeleton" application. Enter "y" and hit enter. Say "n" to verbose output.
Now you'll be asked for your database configuration.
The first prompt for "Name:", is just the name that you want to call this configuration grouping.
You can leave it as "default" (the value that cake assumes by default).
You'll also be prompted for the driver to use. If you use PHP5 & MySQL, I recommend using the "mysqli" driver (note the i on the end). This is a higher quality implementation of mysql that came out with PHP5.
I also always hit "n" for persistent connection (MySQLi doesn't even support persistent connections currently, though MySQLnd will rectify that)
Proceed to enter the rest of your db details.
One note regarding the database settings, I personally use "utf8" encoding in my MySQLi connection in CakePHP.
I also set my Database, Tables, and all of my columns to use utf8/utf8_unicode_ci. You're not required to use UTF8 though, that's just a preference of mine.
Once you've finished entering your database details, the database config file will be written and the cake console will close out.