Skip to main content

How to install cakePHP in Windows

CakePHP is a free, open-source, rapid development framework for PHP. It’s a foundational structure for programmers to create web and database applications.
http://en.wikipedia.org/wiki/CakePHP

Make sure ‘Wamp Server’ has been correctly installed to your machine and start ‘Wamp Server’.
Download CakePHP zip folder from http://cakephp.org/downloads
Extract the zip folder
Create a new folder at C:\wamp\www and name it as you want. (In here it was named as ‘cakephp’)

Figure 1
Then copy all contents of the downloaded folder to newly created ‘cakephp’ folder.

Figure 2

Then open your browser and go localhost/cakephp(localhost/your_folder_name). You may see a window like this.

Figure 3

If you are get a window like this now you have to do some extra work on Wamp Server.
Click on wamp icon on the taskbar go to Apache->Apache Modules.
Then find out rewrite_module and click on it to make it enable.

Figure 4

Note :- If rewrite_module is already enabled in your machine you directly get that colorful window which shown below figure 5

Reload your page localhost/cakephp
Then you will surely see this window.

Figure 5

Now we have successfully done many significant steps in our procedure .
Then we have to configure our database connection.
For that, go to phpmyadmin and make a database which you want to access through cakePHP framework (In here I’ve created a database called ‘school’)
Then go to the folder  C:\wamp\www\cakephp\app\Config

Figure 6

Rename database.php.default file to database.php.
Open database.php file and edit it as below in figure 7.

Figure 7

Note :- In here,we are going to log-in to the database as root without a password. It’s up to you. If you have already made another user with a password you can add those details for this file.

Save the database.php file and reload your localhost/cakephp window.
You will see the successful database configuration with green boxes.

Note:- In this scenario no need to worry too much about Debugkit which shown in yellow box.

Figure 8
Now we should work on those red notice boxes to make them green.
Open the core.php file which is at app\Config\core.php.

Figure 9

Find out security.salt and change it.(add some alphanumeric numbers or delete some numbers)
Save the core.php file and reload cakephp window.

Figure 10
Then the red notice about Security.salt has been vanished.
Now there is only one red notice box about Security.cipherSeed (Figure 11).
Then open core.php file and edit cipherseed code.

Figure 11

Again save the core.php file and reload cakephp window.
Now you can see all red notice boxes have been vanished now.

Figure 12
I’m am happy to say that you are successfully configure cakePHP framework to your machine.
Now it’s time to bake our cake.

Bake – It makes funny when you heard it first time. That is the key feature of the cakePHP framework.
 

Simply, when you bake your tables in the database, cakePHP creates php files for you to access those tables easily.  Woooww…!!!





We use command prompt to bake our tables, before bake them you should need to set paths correctly.
We can do it in 2 ways.
1)Set path permanently by setting environment variables.

Go to Control Panel-> System  ->Advanced System Settings-> Advanced -> Environment Variables->New

Variable Name = Path
Variable Value = %PATH%; C:\wamp\bin\php\php5.4.3; C:\wamp\www\cakephp\lib\Cake\Console

Note :- make sure to set correct paths according to your machine

Figure 13

2)Each and every time when you need to bake, you have to set the path on command prompt.

Figure 14

So the best way is the 1st method to set environment variable.
Whatever the method that you going to be used, you can verify whether the path set is correct or not. For that you have to type ‘cake’ on cmd.

Figure 15


Now you can bake your tabels with cakePHP. 
Go to the folder C:\wamp\www\cakephp and type 'cake bake all'.

Important :- make sure whether all names of the tables end with ‘s’ Otherwise cakePHP doesn’t allow to bake that table. It’s a convention of cakePHP framework.
Eg:- You cannot bake a table named student unless you can bake a table named ‘students’.


Figure 16

Important :- make sure whether all names of the tables end with ‘s’ Otherwise cakePHP doesn’t allow to bake that table. It’s a convention of cakePHP framework.
Eg:- You cannot bake a table named student unless you can bake a table named ‘students’
You can bake each table by entering given numbers.
If you need to bake students table enter 1.
After the bake has been successfully done, you can see that table through cakePHP.

To access students table you can go through localhost/cakephp/students.
Then you can see existing data on that table and you also can add,view,edit and delete data easily. You do not need to worry about sql or php.


Figure 17
Enjoy cakePHP framework...!!!

Comments

Popular posts from this blog

IbirdsPro – Identify birds in Sri Lanka via their colours

This application for nature lovers especially who interested in birds. This is recommended for anyone to improve the knowledge about birds even for beginners. Users can use this application in anywhere because this application doesn’t need any internet connection. This is the upgraded version of the application - Ibirds which is capable to identify forest birds in Sri Lanka. There are more enhanced features in the application. 3 detailed sketches with including 8 parts. (bill, head, face, neck, feathers, breast, tail, legs) High efficient colour matching algorithm Optimized for both android phones and tablets. Contain a large database about the birds. This is the list of birds containing in three sections in IBirdsPro 1.0 version. Section 1     Crimson-fronted Barbet Brown-headed Barbet Yellow-fronted Barbet Brown-capped Woodpacker Yellow-crowned Woodpecker Lesser Yellownape Streak-throated Woodpecker Rufous Woodpecker Black-rumped Flameback Great...

Spatial Data Processing Library for Stratosphere

Stratophere is big data analysis platform which implements through parallel programming concepts. Stratosphere's programming model provides six parallelizable operator functions Map Reduce Join  Cross CoGroup Union JTS library is a standard java library to perform geographical analysis with special data types like points, paths, polygons. In this spatial data processing library, we are going to implement various geographical analysis such as intersections, joins with big map data in standard formats like OSM(Open Street Map) There is some effort in here to create new data types in stratosphere which is compatible with JTS library. Here is an example to Stratosphere Java API with WordCount example. You can simply download the stratosphere-examples and check it your own. When you need to familiar with stratosphere, there is exercises in bigdataclass website. You can find out those implemented exercises in java. Word Count examp...

Setting environment variables in ubuntu

Ubuntu has a nice way to configure most of the important softwares (java,sbt,scala,....etc) without installing through ubuntu software centre- sudo apt-get install ….... You only have to do is, download that files folder and put it that folder wherever you like and set environment variables. That's all.  Java Configuration  Go to this url  http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html   Download  jdk-7u45-linux-x64.tar.gz  Move that file where you want to store.  In here I've created a directory named 'hms' in my home folder and in hms there is a directory called 'installs' (path = /home/shashika/hms/installs )  Then go to your directory and extract the jdk-7u45-linux-x64.tar.gz file Then you can see the extracted file Now the important part. That is set the jdk/bin path in bashrc file which is in your home folder.  If you can see it in your home folder press ctrl-h then you ...