Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Base lambda function for closure not found #511

Closed
raamdev opened this issue Jun 27, 2015 · 6 comments
Closed

PHP Fatal error: Base lambda function for closure not found #511

raamdev opened this issue Jun 27, 2015 · 6 comments
Labels
Milestone

Comments

@raamdev
Copy link
Contributor

@raamdev raamdev commented Jun 27, 2015

We've had several reports of ZenCache v160626 causing blank pages on sites, and some reporting the following error (this error is likely what's causing the 'blank pages', which occurs when a site does not have WP_DEBUG enabled):

PHP Fatal error: Base lambda function for closure not found in /home/example/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 15

This PHP Bug report appears to indicate known issues with using lambda functions on systems running APC Cache and it appears that as of today the issue still has not been fixed: https://bugs.php.net/bug.php?id=52144


Steps to reproduce this bug

  1. Install PHP v5.3.20 with APC Cache enabled
  2. Install and Activate ZenCache v150626 (either Lite or Pro)
  3. Visit the ZenCache plugin options (sometimes it takes one or two page changes before the error appears, but it's consistent within 1-2 page changes).

Expected behavior

ZenCache activates.

Observed behavior

Fatal Error:

Fatal error: Base lambda function for closure not found in /Users/raam/Sites/zcpro.dev/wordpress/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheLockUtils.php on line 19


Site Owners: If you're experiencing this issue:

We're still investigating this issue and will provide further updates below. While we're working on a fix issue, you can downgrade to the previous version of ZenCache (Lite v150409 | Pro v150409). Simply uninstall the current version of ZenCache and then you can install the previous version (see also: How do I uninstall ZenCache?).

Or you can implement this short-term workaround described below.


Support threads referencing this issue

@raamdev raamdev added the bug label Jun 27, 2015
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Jun 28, 2015

PHP v5.4.10 + APC Cache = Working

PHP v5.4.10 + APC Cache is working and does not produce the fatal error, so this would further confirm that what we're seeing is PHP Bug #52144.

Edit: This APC bug appears to affect multiple major versions of PHP. See below for a temporary short-term workaround.

@raamdev raamdev added lite pro labels Jun 28, 2015
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Jun 28, 2015

PHP v5.3.20 + APC Cache = Broken!

Installing ZenCache v150626 on a system running PHP v5.3.20 with the APC Cache extension enabled produces a Fatal Error, as the result of PHP Bug #52144.

Temporary Workarounds

See short-term workaround below.

@jaswrks
Copy link

@jaswrks jaswrks commented Jun 28, 2015

@raamdev Nice work in reproducing this.

So far I have been unable to reproduce this on Ubuntu 12.04 64-bit running PHP v5.3.10 (or v5.3.20), and APC 3.1.7 Revision: 307215. Any other details you can provide about the specific OS and version of APC that you used to reproduce this? Did you build a Vagrant box to test this with? Once I can get it reproduced, debugging may shed light on a workaround for a specific PHP + APC version.

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Jul 2, 2015

Workaround

If your server is running the APC Extension, you should disable it. The APC Extension is buggy and has been replaced by the newer Opcache extension (which is enabled by default in PHP 5.5+). The PHP community has stopped developing the APC extension and the last release was way back in 2012, so the best course of action if you're stuck running on PHP 5.3 or PHP 5.4 is to simply disable the extension altogether:

  • Open your /wp-config.php file.
  • At the top, right after <?php, on the next line add: ini_set('apc.cache_by_default', false);

This will disable APC at runtime and prevent the bug that's throwing the Fatal Error.

If you're unable to disable APC in this way, you'll need to contact your web hosting company to have them upgrade your server to a newer version of PHP (e.g., PHP 5.5+).

@raamdev raamdev modified the milestone: Next Release (Pro) Jul 10, 2015
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Jul 14, 2015

ZenCache Pro Changelog

Pro changelog that resolves this GitHub Issue:

  • Bug Fix: Fixed a fatal error that was occurring on some sites after upgrading to v150629. We discovered the fatal error was related to PHP's outdated and buggy APC extension, which is often active on sites running PHP 5.3 and PHP 5.4. We now prevent activation of ZenCache on systems with the APC extension enabled and show a warning message instead. We've written a KB Article that further explains the APC Extension Warning and offers advice to site owners who are currently running APC. See also Issue #511.

ZenCache Lite Changelog

Lite changelog that resolves this GitHub Issue:

  • Bug Fix: This update reverts the codebase restructure released in the previous version (v150626). That release received several reports of Fatal Errors, however those issues only affected a small subset of ZenCache users. After extensive research, we discovered that this issue was related to a bug in PHP's APC Extension (which is commonly used on systems running PHP 5.3 and PHP 5.4). The restructured codebase in the previous release utilized a newer PHP feature (Closures) and that increased the likelihood of exposing that existing PHP bug. Since we can't fix the PHP bug directly and we want to continue supporting PHP 5.3.2+ and PHP 5.4 for now, we're reverting the ZenCache Lite codebase restructure to the previous version (v150409). The new ZenCache Lite features that were included in the previous release are still available in this release--only the structure of the codebase itself has changed. To read more about the PHP APC bug, see Issue #511.
@raamdev raamdev closed this Jul 14, 2015
@wpsharks wpsharks locked and limited conversation to collaborators Jul 17, 2015
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Jul 17, 2015

This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#511).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants