Archive for the ‘ Uncategorized ’ Category

How to set up Zf2 (Zend Framework) in mamp server

Zend framework released their beta 2 version. I just planned to start work with that. Because I have seen lots of interesting features in zend framework . If you want to see more details about features then you may visit (

So I start to create a project with ZF2.0 . But I faced few problem to see the welcome screen . So here I describe how quickly you can set up a zf project .

First let us know the requirement of ZF 2.0


I assume that you have an idea for the following things :

1. how to setup mamp .
2. how to create virtual host .

Requirement :

1. Php 5.3

Download :

Setup on MAMP:

I just want to show how to set up on mamp . I assume that you already set up

1. Now open your php.ini file located under


2. Search for include_path and add the location of your zend framework:

include_path = ".:/usr/lib/php:/usr/local/lib/php:/Applications/MAMP/path of zendframework/ "

or you can include library/zend while you create a project . I will show in later while we create a project.

3. Zend Framework also comes with a shell script that will help you with RAD (Rapid Application Deployment), you can create a shortcut to Zend Tools in terminal by adding an alias to your profile under /etc/profile and make sure to restart terminal after you’ve done so:

alias zf2=/Applications/MAMP/svn/zendframework/trunk/bin/

4. Test if the Zend Tool is installed correctly by showing the version:

zf2 show version

5. Finally navigate to the directory you’d like to create your first project in:

zf2 create project quickstart

And then I create a virtual hosts for and when I browse that i have seen a blank page . Then I try to find the error . so I open the php error file by this command : tail –f php_error.log

In that file I have seen lots of error message where most of the error messages are that files are not found.

So I have checked the files. I open a file controllers/indexController.php file . There I find nothing has been written . Same things happened for error Controller . So I have looked at the:

. And there I found that how to extend the controller and also how to extend the class. So now again browse the and now I have seen it works for me .


Facebook IFRAME Application Issues : PART-1

While I switch one of my fb application  from FBML to iframe , I have faced some silly problem. But to solve those problems , I have to waste so many hours. After searching the forum, asking mates and friends and then find out the solution.  I am thinking Mahedi hasan to help me a lot. When I got the solution I found that it’s a very 1 or 2 min jobs.   I have found mostly these problem arise in the beginning of application and basic issues. I hope so you will share your iframe problem too .

Here are the problems that I have faced  while developing an iframe application:

1. POST Submission problem :

While I submit the post data unfortunately I  do not get any post data. I have found that post field is empty. I am very surprised how my $_POST field is empty though it submit the action page.   I have given a sample form of my application.

Posting it via the server url:

<form action="" method="POST">
<input type="text" name="test1"></input>
<input type="submit" name="Submit"/>

Posting it via the app callback url:

<form action="" method="POST">
<input type="text" name="test1"></input>
<input type="submit" name="Submit"/>

After search in  facebook developer wiki,forum and blog , I have known that

while submit the form , iframe lost the session key as there is no session key passed . As a result it lost user id and lost all the post data. That’s why i have to set user_id. So below is the forum post link :

And  here Is how I solve this issue . This my modified form where I added two  hidden fields. One is fb_sig_session_key and another one is user_id.

Posting via fb_sig_session_key and user_id

<form action="" method="POST">
<input type="text" name="test1"></input>
<input type="hidden" name="fb_sig_session_key" value=”<?php $_GET[‘fb_sig_session_key’]”></input>
<input type="hidden" name="user_id" value=”<?php $_GET[‘user_id’]”></input>
<input type="submit" name="Submit"/>

So after submit the form here I show how can I set_user and now find the post values.


if (isset ( $_REQUEST ['kb_fb_sig_session_key'] )) {

$this->fb_sig_session_key = $_REQUEST ['fb_sig_session_key'];


if (isset ( $_REQUEST ['user_id'] )) {

$this->uid = $_REQUEST ['user_id'];


if ($this->uid != '') {

$this->facebook->set_user ($this->uid, $this->kb_fb_sig_session_key );


$this->facebook->set_user ($this->uid, $this->fb_sig_session_key );


2 . Application  Link  problem :

While I click on any link in my iframe application , I have found that it reloads the whole facebook page again in the iframe canvas. I just use this type of code and found the problem load  .

<a href=””>Invite</a&gt;

I found the solution in this thread :

Only add the taget=”__top” into the anchor.

So I add target=”_top”. <a href=””>Invite</a&gt;.   And now it work.

3.iframe size problem  :

I have faced problem to resize my frame application. Initially when page load the frame size is correct. But when I show the facebook profile photo of users , then find that it does not resize. I do not see the footer and it cut down. We have solve this problem by adding  javascript setTimer to resize the height. You have seen similar type problem here :

4.  Setting issues :

I think to set up my application as an iframe application, I do not need to set up the connect url. But when I do not set up connect url I see blank page. So when I set up the call back url , I have found that my application working.

I think to set up my application as an iframe application, I do not need to set up the connect url. But when I do not set up connect url I see blank page. So when I set up the call back url , I have found that my application working.

I have few more issues and will be add next topics.

My new DELL XPS M1640

Finally i have gotten my new DELL Studio XPS 1620. I have been waiting for buying a laoptop so many days. And Mizan bhai help me to bring this laptop from USA. This laptop has been bought by from ebay. After 1 week waiting i have gotten my laptop.

The awsome design dell xps will forget you everything.It has Premium design with genuine leather accents, anodized aluminum, edge-to-edge display and backlit keyboard. The leater acents make it very unique desing and make it very luxarious goods. And the backlit keyborad make you always typing in the key board . Now i can even work in the dark night . So my roommate are happy to switch off the light while sleeping. And the 16”” with edge to edge display is very interesting.

Here is the features of My New Dell XPS M1640 Studio XPS 16 Intel® Core™ 2 Duo P7350 (3MB cache/2.0GHz/1066Mhz FSB) Genuine Windows Vista® Home Premium Edition SP1, 64-bit LCD Panel Edge-to-Edge HD Widescreen 16.0 inch WLED LCD (1366×768) W/2.0 MP MEMORY 3GB2 DDR3 SDRAM3 at 1067MHz (2 Dimms) Hard Drive 320GB5 7200 RPM6 SATA Hard Drive Battery Options 6-cell Batterydell-xps-13-16-1

Awesome PHPXperts Seminar 2009.. Overview OpenSource Ecommerce Application – Magento

Recently an Awesome PHPXperts Seminar,2009  had been held at BRAC University , Dhaka .PHPXperts is one of the largest community in Bangladesh. At that seminar lot of programmers were present under a roof. And the presentation topic was the “Current development trends.” And I have an opportunity to speech on that seminar. Thanks Hasin bhai and other moderators to give this opportunity.

I am sharing my present slide at slide share.

In my presentation, my intension is to know the basic ecommerce features and the tools to make an ecommerce solution. For the tools I have described the mostly popular and idely used 4 open source solutions.

They are oscomemrce, zencart, virtumart and magento. And share with little with all the features ,pros and corns of those ecommerce . And finally I have give the idea about current ecommerce application trends  which is magento .

After that presentation I found that lots of peoples are interested about the ecommerce solution. And I just want to say that I am very sorry for those who raise hands but they do not get the chance to ask questions. Because of our shortage of time. But I will be glad if you contact with me to know anything or  any suggestion  .:)

start writing about facebook application

recently hasin bhai start a blog about facebook application which is . This blog basically focus on the quick solution on the common problems of facebook application. Here also write  others opens source enthusiast from Bangladesh. I am also start writing on that blog which i learn. Hopefully you will get a nice solutions from that blog.

Speed Up your Web Application by CodeIgniter

Now a days one of the big issue you have to focus that to High speed your web site performance. I have read a nice article” Performance tips for web applications” where focus the performance tips of web application. These tips can easily apply by codegIniter . Let see some of the tips below.

Some of the techniques are :

  • Enable GZIP Components.
  • Make Fewer Http Request .
  • Adds an Expires Header.
  • Minify JavaScript.

Enable GZIP Component :

In the system/application/

change the config variable true

   1: $config['compress_output'] = TRUE;

Make Fewer HTTP Request :

1. Caching the site.

Each time file loads from your web server, it generates an http request. So you can reduce number of http requests by caching some contents which are almost static or changes very rarely. if these contents are loaded from browser cache, there will be no request for them over HTTP.

So you can easily caching your web Pages in the CodeIgniter :

Enabling Caching

To enable caching, put the following tag in any of your controller functions:

   1: $this->output->cache(n);

Where n is the number of minutes you wish the page to remain cached between refreshes.

The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems most logical to you. Once the tag is in place, your pages will begin being cached.

To set data you can do it by the

   1: $this->output->set_output($data);

Also you can manually set header :


Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

   1: $this->output->set_header("HTTP/1.0 200 OK");
   2: $this->output->set_header("HTTP/1.1 200 OK");
   3: $this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
   4: $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
   5: $this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
   6: $this->output->set_header("Pragma: no-cache");

2. join multiple css or js file into single css or js file .

It can be done in many ways . But in the CodeIgniter forum i find some ways to do that . You can check out here. The below code is the forum message :

Following is the controller to join multiple cs or jss
file in to one, and hence making fewer server request to speed up the things little bit.

Just add following in to your controllers. save as file.php Set the path of your
js and css files accordingly.

   1: <?php
   2: class File extends Controller
   3: {
   4: function File()
   5:     {
   6:         parent::Controller();
   7: /*Set your own path here*/
   8: $this->_path = "./public/";
   9: }
  10: function index()
  11: {
  12: echo "";
  13: }
  14: function js()
  15: {
  16:         $segs = $this->uri->segment_array();
  17:         foreach ($segs as $segment)
  18: {
  19:             $filepath = $this->_path.$segment.'.js';
  20:             if(file_exists($filepath))
  21: {
  22:                 readfile($filepath);
  23: }
  24:         }
  25:     }
  26: function css()
  27: {
  28:         $segs = $this->uri->segment_array();
  29:         foreach ($segs as $segment)
  30: {
  31:             $filepath = $this->_path.$segment.'.css';
  32:             if(file_exists($filepath))
  33: {
  34:                 readfile($filepath);
  35: }
  36:         }
  37:     }
  38: }
  39: ?>

Now you can add any number of files with just single line of code,and with single
For e.g. If you want to include two css file , foo.css and bar.css , the code is ,

   1: <link rel='stylesheet' type='text/css' media='all' href='<?php echo site_url("file/css/foo/bar");?>' />

The alternative of that one is :

got a script from somewhere that gzips the css/js, caches the compilation of the files etc. Since I generally use jQuery I my controller also has the function jQuery. I can now do

<?PHP echo site_url(asset/jquery); ?>

This redirects to a similar function as you have but a bit shorter.

Adds an Expires Header:

you can add expire header by the Ci library output class.

Minify JavaScript:

You can minify javascript by packed, Minify.

Joining Right Brain Solution

rbs.pngRight Brain Solution

I have joined the Right Brain Solution . After 7 months at ECBB , I make up my mind to switch my job to take new challenges and working with talented team members.

After met with the Md. Emran Hasan, who is a CTO and Co-founder , I realize that he is not only technically great, but also has a very high goal set up in his mind and good managerial skill. I also found in the team the very hard worker, great learner and obviously the creative minded which reflects the company name Right Brain Solution.

I hope so i will pass a great time with the Md. Emran Hasan and obviously with talented team members.

Saidur Rahman,
Software Engineer,
Right Brain Solution Ltd