Showing posts with label cakephp. Show all posts
Showing posts with label cakephp. Show all posts

Sunday, July 17, 2011

Transferring cake baked code from windows to centos (linux)

First thing to do is to install cakephp in centos. Please refer to my previous blog on this(http://codebyte.blogspot.com/2011/07/installing-cakephp-in-centos.html) if you have not already installed cakphp.

Now, transfer your code to your document root (For e.g. /var/www/html in my case). Suppose, the name of your application is myapp, then
1. Open var/www/html/myapp/webroot/index.php

  • Search for if (!defined('CAKE_CORE_INCLUDE_PATH')).
  • You may find something like: define('CAKE_CORE_INCLUDE_PATH', 'C:' . DS. 'xampp' .DS. 'cake' if you used xampp in windows.
  • Change this to the location of your installed cakephp folder. For e.g. define('CAKE_CORE_INCLUDE_PATH', .DS . 'var' . DS. 'www' .DS. 'html' .DS. 'cake')

2. Open /var/www/html/myapp/config/database.php and provide appropriate database settings.

Finally, restart your apache server (/etc/init.d/httpd restart).

Installing CakePHP on CentOS

Download Cakephp
https://github.com/cakephp/cakephp/downloads

Rename it to something like cake. Extract from .tar.gz files.
tar -xvzf cake

Put 'cake' folder inside your document root. For e.g. if your document root is /var/www/html, put the cake folder inside it. Then follow some guidelines below.
1. Give appropriate permission setting for your 'cake' folder.
2. Open /cake/app/config/core.php. Go to the line where security.salt is defined and change it to some other value. Also do the same for security.cipherSeed.
3. Rename database.default.php to database.php and provide appropriate database settings

Now, open your browser and go to http://localhost/cake.

If you do no see any color in the page, you might want to check two things. Go to /etc/httpds/conf/httpd.conf and
1.  Search for mod_rewrite.so and check if LoadModule rewrite_module_modules modules/mod_rewrite.so is commented. If so, remove the comment.
2. Search for 'Options Indexed FollowSymLinks' and change 'AllowOverride None' to 'AllowOverride All' as below:
   <Directory />
    Options Indexed FollowSymLinks
    AllowOverride All
   </Directory>
 Note: Make sure you make the change in 'Options Indexed FollowSymLinks' and not in 'Options FollowSymLinks'.

Finally, restart apache (/etc/init.d/httpd restart).

Friday, June 17, 2011

CakePHP for beginners

This is my attempt to help you out if you are starting to learn cakephp.

If you want to install CakePHP in xampp, the below link will be helpful for you.
http://narenbimal.blogspot.com/2008/07/cake-is-php-web-development-framework.html

For the basic knowledge and tutorial you can go to the site.
http://book.cakephp.org/view/879/Beginning-With-CakePHP

To start learning with CakePHP, I found tutorials on youtube. It makes learning easy and convenient as we get the clear idea of what should be done. The uploader 'Andrew Perk' has made 10 tutorials starting from:
http://www.youtube.com/watch?v=nO9oSQhRa9s
You can view the rest 9 tutorials from the suggestions.

He has also made 3 more tutorials for authentication i.e. for login and logout which starts from:
http://www.youtube.com/watch?v=FjXAnizmR94
You can also see other tutorials there.

Hope you found this information useful.
Happy Coding!!