Archive for setup

How to setup CakePHP

Posted in CakePHP, CakePHP 1.2 with tags , , on April 30, 2009 by myleskadusale

STEP 1

AllowOverwrite is Set to All
We need to make sure that the web root directory, or the directory in which we plan to keep CakePHP has AllowOverwrite set to all. We can do this by checking Apache’s main configuration file http.conf. This file should be located in the directory called conf, where we have installed Apache. In this file, there should be option for the web root directory. As the following configuration shows, the web root (which is L:/wamp/www for this particular installation) has a Directory entry in which the AllowOverwrite option is set to all. If the directory under web root, in which we plan to keep Cake, has a directory entry, we need to check that one too.

<Directory “L:/wamp/www”>
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>

STEP 2

Mod_rewrite Module is Loaded
We also need to make sure that the Apache is loading the mod_rewrite module. To do this, we again have to check the http.conf file. There should be a section in the http.conf file named Dynamic Shared Object (DSO) Support, where all the different modules that are loaded by Apache are listed. The modules that are not being loaded are commented out with # in the beginning of the line. So, we need to make sure that the mod_rewrite module line is not commented out. If it is, we just need to remove the # from the beginning of the line:

LoadModule rewrite_module modules/mod_rewrite.so

Make sure to restart Apache once you have made the above changes.
As long as the above configurations are set accordingly, Apache should be running CakePHP applications without any issues at all.

STEP 3

Copy CakePHP to www

STEP 4

So the directory structure will be  somewhat like this

C:\wamp\www\CakePHP

To test your installation go to your web browser and enter similar to this URL

http://localhost/CakePHP

depending on your setup.

That’s It 🙂

By the way there are 3 types of setup or installation in CakePHP.  If you are going to develop a WebApp use development setup where you can see the SQL logs in your page.  For more info click here

Advertisements

Adding syntax highlighting for .ctp files in PHPEclipse

Posted in CakePHP, CakePHP 1.2 with tags , , , , , , , on April 30, 2009 by myleskadusale

Adding syntax highlighting in files that has a .ctp filename extension.
First go to Window -> Preferences
Then select General then Content Types, in the other side select Text then select PHP Source File and click the add button to add .ctp files under PHP Source File.

That’s it.   Happy Coding.

Dealing Large Tables in MySQL

Posted in MySQL with tags , , , , , on February 25, 2009 by myleskadusale

Today I found a site that gives good tips in dealing large tables in MySQL.

Why MySQL could be slow with large tables