Sunday, June 19, 2011

Installing Eclipse Galileo , PHPEclipse plugin and SVN plugin

Steps to Install Eclipse Galileo on Ubuntu , PHPEclipse and SVN plugin  :

Start with Eclipse Installation first
 
   Login as root user
    
   Update the package repository by the following command :
         apt-get update (or) aptitude update
     
   To install eclipse use the following command :
         aptitude install eclipse
 
   This will complete the Eclipse Installation.

Now, Install PHPEclipse and SVN plugins
 
   Go to Applications->Programming->Eclipse

   In Eclipse menubar, select Menu->Help->Install New Softwares

   Click on Add, and insert the follwing:
   
   Installing PHPEclipse plugin
 
     Name: PHPEclipse

     URL: http://phpeclipse.sourceforge.net/update/nightly_1.2.x/
  
     If the above Url doesn't work, then use the URL below
      http://phpeclipse.sourceforge.net/update/stable/1.2.x/

     Now click on Next, select the items to be installed and Finish.

     After Installing PHPEclipse, restart your eclipse to view the changes.

   Installing SVN plugin 

    Name: Subversion

     URL: http://subclipse.tigris.org/update_1.4.x

     Now click on Next, select the items to be installed and Finish.

     After Installing Subversion, restart your eclipse to view the changes.
 

Saturday, June 18, 2011

Installing CAKEPHP on your ubuntu machine

Hi Everyone,
 
         I'm listing out the steps to install cakephp :

 1. Install the necessary packages using the command
       sudo apt-get install apache2 mysql-server php5

 2. In case you encounter any Lock Error, make sure no other installation is
     happening and close Synaptic Package Manager if open. Even if the problem
     exists, execute sudo killall apt-get

 3. Enable Mod-rewrite: sudo a2enmod rewrite

 4. Download the latest stable version of cake from http://cakephp.org/ and save
     it to your machine.

 5. Extract the downloaded file and rename the extracted folder with your project
     name(assume, project name is cakephp) and move it to the document root
     (most of the times it will be /var/www/)


 6. Give writable permission to tmp folder:
     sudo chmod -R 777 cakephp/app/tmp

 7.  Open file /etc/apache2/sites-enabled/000-default  using command
       sudo vim /etc/apache2/sites-enabled/000-default
       and change AllowOverride None to AllowOverride All.
     i.e, change the following content 
     <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
     </Directory>
                            TO
     <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
     </Directory>
 
 8. Create .htaccess file inside the project directory
    sudo vim.tiny /var/www/cakephp/.htaccess
     and add these contents:
     RewriteEngine on
    RewriteRule    ^$ app/webroot/    [L]
    RewriteRule    (.*) app/webroot/$1 [L]


 9. Restart Apache: sudo /etc/init.d/apache2 restart
 Cakephp installation is now complete. Open http://localhost/cakephp from
 browser.

 If in case, you have an error 
 " Your database configuration file is NOT present" after installing
  then execute the following command : 
  sudo aptitude install php5-mysql
  and restart the apache service.

 Guided by Arjun Urs(http://arjunurs.blogspot.com/)

Introduction to CAKEPHP and MVC architecture

CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. It uses MVC software design pattern.

MVC design pattern divides the application into three main parts :
Model : The model represents the database table.
Controller : It is used for writing logic for your application. All your business logic needs to be put into controller.

View : It is used to present the data of your application to end user.


Understanding MVC architecture :
         Whenever a user accesses the MVC application the dispatcher hands over the request to controller, controller performs the required operation with model(data in database table) and sends the request to view where the data is presented for the user.

Refer : http://book.cakephp.org/view/880/What-is-CakePHP-Why-Use-it#!/view/890/Understanding-Model-View-Controller