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’)
Then copy all contents of the downloaded folder to newly created ‘cakephp’ folder.
Then open your browser and go localhost/cakephp(localhost/your_folder_name). You may see a window like this.
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.
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.
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
Rename database.php.default file to database.php.
Open database.php file and edit it as below in 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.
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.
Find out security.salt and change it.(add some alphanumeric numbers or delete some numbers)
Save the core.php file and reload cakephp window.
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.
Again save the core.php file and reload cakephp window.
Now you can see all red notice boxes have been vanished now.
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
2)Each and every time when you need to bake, you have to set the path on command prompt.
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.
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’.
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.
Enjoy cakePHP framework...!!!
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 |
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 |
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 |
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 |
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 |
Comments
Post a Comment