Thursday, February 3, 2011

Cakephp Installation Step By Step In windows


1. Download Cakephp

Requirements

  • Database: MySQL Versi 5.0.x
  • Web server: Apache 2.x
  • PHP 5.2.x and below (do not install PHP 5.3.x)
  • PHP GD Module (to display custom banner)
  • PHP DOM/XML Module (to enable pdf downloading)
  • PHP memory_limit (in php.ini) set to >30MB - this is currently a limitation that's going to be fixed
Minimum hardware requirement
  • Pentium IV
  • 1GB RAM
  • 28MB hardisk (without data)

Server Requirements

·  An HTTP server (like Apache) with the following enabled: sessions, mod_rewrite (not absolutely necessary but preferred)
·  PHP 4.3.2 or greater. Yes, CakePHP works great in either PHP 4 or 5.
·  A database engine (right now, there is support for MySQL 4+, PostgreSQL and a wrapper for ADODB

Setting Up CakePHP

The first way to setup CakePHP is generally only recommended for development environments because it is less secure. The second way is considered more secure and should be used in a production environment.

Development Setup

For development we can place the whole Cake installation directory inside the specified DocumentRoot like this:
    /wwwroot
    /cake
        /app
        /cake
        /vendors
        .htaccess
        index.php
 
In this setup the wwwroot folder acts as the web root so your URLs will look something like this

  1. <a href="http://www.example.com/cake/controllerName/actionName/param1/param2" title="Linkification: http://www.example.com/cake/controllerName/actionName/param1/param2">www.example.com/cake/controllerName/actionName/param1/param2 >

Production Setup

Utilize a production setup, you will need to have the rights to change the Document Root on your server. Doing so, makes the whole domain act as a single Cake PHP application.
The production setup uses the following layout:
../path_to_cake_install
    /app
        /config
        /controllers
        /models
        /plugins
        /tmp
        /vendors
        /views
        /webroot <-- This should be your new DocumentRoot
        .htaccess
        index.php
    /cake
    /vendors
    .htaccess
    index.php

Edit your apache configuration file

Find the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder.
Add in this line in your configuration file “access file name htaccess.txt”.
Make sure that an .htaccess override is allowed: in your httpd.conf, you should have a section that defines a section for each Directory on your server. Make sure the AllowOverride is set to All for the correct Directory.
Make sure you are loading up mod_rewrite correctly! You should see something like LoadModule rewrite_module libexec/httpd/mod_rewrite.so and AddModule mod_rewrite.c in your httpd.conf..
you might also add "php_flag session.trans_id off" to the .htaccess file at the root of your installation

Now you should point your browser to http://www.example.com or http://www.example.com/cake.
Now you can create your first cake-based Application.

No comments:

Post a Comment