"Lit the Candle"

Editing *.ctp file in Eclipse.

Eclipse is a famous editor for the development with php. But to code with cakephp we need to configure this eclipse editor. Because by default eclipse does not hightlight the html or php syntex of cakephp view file.Here are the steps to set up eclipse for highlighting the codes in a .ctp file.

  • Firstly open the  Eclipse workspace.
  • Now go to Preferences from Window menu.
  • From Preference click on the General tab from the list.
  • Now click on Content-Types under General  tab.
  • On the right panel in the Content-Types, expand the Text tab.
  • Select PHP Content-Types .
  • There are all the lists of  files associated with php in below e.g. *.php,*.php3,*.php4
  • Now click on the Add button and type the fie extension e.g. *.ctp in the content type input field.

Now you need to reopen the file  you are working on.

Happy coding :)

September 3, 2009 Posted by milansaha | CakePhp, Uncategorized | | No Comments Yet

Uploading error named “Error creating folder” in Fckeditor

Last few days i was trying to solve a path issue regarding the Fckeditor. I was using the editor with php.It was little bit annoying this time cause it took few hours to find out. The editor was working fine wihtout any problem. For no reason suddenly the editor started showing the error messge while i was tyring to upload an image with the html editor. Most of the time the error seems more or less like below :

  • Error creating folder '/Resources/ImageFile/image' {Can't create 'image' directory}
  • Not getting the UserFilesAbsolutePath.

Well the editor have a configuration file for solving this issue with php.Here we need to be sure for the following three lines of code.

  1. $Config['UseFileType'] = true ;
  2. $Config['UserFilesPath'] = ‘/Resources/ImageFile/’ ;
  3. $Config['UserFilesAbsolutePath'] = ‘D:/PHPWorks/alpha-v2/Resources/ImageFile/’ ;

Remember the file path for UserFilesAbsolutePath usually not given while we download Fckeditor. In few versions of fckeditor it works fine without this path. But to stop the error message if any we should enter an absolute path for the destination directory. In my case my server was a windows server. Thats why i used the absolute path like above.

Last but not least imoprtant issue is the chmod of the destination directory should be set to 777 that means the directory should be writable to upload an image in it.

August 22, 2009 Posted by milansaha | HTML, PHP | | No Comments Yet

Magento configuration to change site URL

In magento by deafult the configuration information for site management is kept in database table. The name of the table is ‘core_config_data’. If we analyze the tables we get that magento keeps its data in the following table. So if we want to develop our application in our localhost and then deploy the site in the hosting server we might need to change the path accordingly to run the site from that server.

Here we see that magento keeps its base url as below

(2, ‘websites’, 2, ‘web/unsecure/base_url’, ‘http://192.167.3.7/magento/’)

So here we can change that url easily as we need to. This way we can configure multiple URL for multiple site also. In my case this tricks worked fine with Magento 1.3.1

CREATE TABLE `core_config_data` (
`config_id` int(10) unsigned NOT NULL auto_increment,
`scope` enum(‘default’,'websites’,’stores’,'config’) NOT NULL default ‘default’,
`scope_id` int(11) NOT NULL default ‘0′,
`path` varchar(255) NOT NULL default ‘general’,
`value` text NOT NULL,
PRIMARY KEY  (`config_id`),
UNIQUE KEY `config_scope` (`scope`,`scope_id`,`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ;


– Dumping data for table `core_config_data`

INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`) VALUES
(1, ‘default’, 0, ‘catalog/category/root_id’, ‘2′),
(2, ‘websites’, 2, ‘web/unsecure/base_url’, ‘http://192.167.3.7/magento/’),
(3, ‘websites’, 2, ‘web/unsecure/base_link_url’, ‘{{unsecure_base_url}}ucc/’),
(4, ‘websites’, 2, ‘web/secure/base_url’, ‘https://192.167.3.7/magento/’),
(5, ‘websites’, 2, ‘web/secure/base_link_url’, ‘{{secure_base_url}}ucc/’),
(6, ‘websites’, 2, ‘web/default/front’, ‘cms’),
(7, ‘websites’, 2, ‘web/default/cms_home_page’, ‘home’),
(8, ‘websites’, 3, ‘web/unsecure/base_url’, ‘http://192.167.3.7/magento/’),
(9, ‘websites’, 3, ‘web/unsecure/base_link_url’, ‘{{unsecure_base_url}}technocare/’),
(10, ‘websites’, 3, ‘web/secure/base_url’, ‘https://192.167.3.7/magento/’),
(11, ‘websites’, 3, ‘web/secure/base_link_url’, ‘{{secure_base_url}}technocare/’),

August 9, 2009 Posted by milansaha | Magento | | No Comments Yet