Take the 2-minute tour ×

we are trying to build an application using the zend framework and have the following problem: "Some controller actions are called twice. This means that the actions gets called, finishes its execution and then gets called again".

We tracked this down by checking entries in a log file. For one request there where 2 entries in the log file.

Do you know anything that might be causing this problem? Is this related with the dispatch process of the Front Controller?


share|improve this question
Maybe your action is calling another function somewhere, that is calling the same action again? –  karim79 Apr 6 '09 at 12:35
I was facing this same problem and it took from me a good amount of time.I ended up having feeling that it was a very nasty joke. –  kta May 17 at 19:57

6 Answers 6

I found out that action got requested twice when Chrome Extension Webug (FirePHP extension for Google Chrome) was enabled.

share|improve this answer
I can not tell you how helpful this was. I had just about given up on this thread when I saw this. Thank you. What a mess to have this extension make a 2nd request. Whew. Anyway, much appreciate it. This was my issue as well. –  Michael Reed Apr 17 '11 at 2:28
Thanks mate, the double requests were driving me crazy but it was indeed the FirePHP (in my case, in Firefox) --- correction, I don't have FirePHP in FF, it was FireBug itself that triggered the second call –  Peter May 9 '11 at 12:43

forward or action stack may be to reason

share|improve this answer

try and use a debugger ( XDebug for example ) to see how your code is runned. focus on the dispatcher, something must have happened and the request action is not set as dispatched so it gets runned again.

share|improve this answer

It might be a bug. Difficult to tell without more information.

Try logging a backtrace each time the action method is called.

trigger_error(var_export(debug_backtrace(), true));
trigger_error(var_export($_SERVER, true));

This will give you tons of info in the error-log, so you'll want to export the result to a text-editor and munch through it there. And/or possibly modify the code to print less info.

A couple of things to look for:

  • Is the action-method called from different places?
  • Is the $_SERVER['UNIQUE_ID'] (or REQUEST_TIME) different?

If the unique-id is different then you've done two requests to the server. If not, try to figure it out from the backtrace.

share|improve this answer

We were having a similar problem. Some actions were executed twice. After much debugging and googling, found out the problem was a bug in ZFdebug. Installed this patch and everything went back to normal. Hope this helps someone else.

share|improve this answer

I'm using Chrome 17.0.x, Webug and Zend Framework 1.11.1 and still seeing this issue. I disabled Webug as suggested and the Action was only called once.

So, I think this is a bug in Webug.

share|improve this answer
I apologize for this error in Webug — in the current version it is fixed. –  fedosov May 23 '13 at 9:08

Your Answer

