yii-debug-toolbar icon indicating copy to clipboard operation
yii-debug-toolbar copied to clipboard

Errors with APC opcode cache enabled

Open cheuschober opened this issue 13 years ago • 3 comments

Hi. I think this project is amazing. I did, however, encounter a bug that I spent a rather long time trying to troubleshoot:

With APC enabled, the yii-debug-toolbar gets its opcode cached which causes errors in any execution after the first. Since Yii has its unique autoloading mechanism we can't selectively set the debug toolbar's directory (via .htaccess):

php_flag apc.cache_by_default 0

If the entire Yii project has its opcode cache disabled the debug toolbar works as-expected. Either a fix or at least a mention in the documentation would be helpful so others don't spend time debugging the debugger. ;-)

cheuschober avatar Nov 09 '11 20:11 cheuschober

Thanks for your feedback

malyshev avatar Nov 10 '11 11:11 malyshev

I use APC 3.1.7 on my development computer (PHP 5.3.8), and I haven't seen any problem with yii-debug-toolbar. You said you got errors, but could you describe them? Which versions of APC and PHP are you using? Which PHP SAPI?

There are some known bugs in several versions of APC, it is probably the cause of your problems. APC crashed randomly on one Debian server with a Yii application, I had to compile a new version (3.1.9). I also had crash problems with an new default of an aggressive slam_defense in new versions. On another Redhat server with no Yii application, APC caused some random CPU bursts (had to restart Apache several time a day) until we recompiled a new APC.

mytskine avatar Nov 10 '11 11:11 mytskine

Hi mytskine.

Our developer machines mimic our production environment (with added tools) and are all ubuntu server stable (10.04). In packages, that means we have APC 3.1.4 and PHP 5.3.2.

I don't have a spare machine right now to try a newer version of either but will try later. If it is APC, I'd still recommend documenting the issue since RHEL 6.0 only packages APC 3.1.3 and a lot of shops have a similar situation (where dev machines are roughly kept in-spec with production).

cheuschober avatar Nov 14 '11 14:11 cheuschober