If you have the apcu extension installed then cli install of Drupal is impossible in php 5.5

Error: Call to undefined function Drupal\Component\Utility\apc_delete_file() in /Volumes/devdisk/dev/sites/drupal8alt.dev/core/lib/Drupal/Component/Utility/OpCodeCache.php, line 36 [5.42 sec, 21.47 MB]

This is because apcu provides a partial emulation of apc. See output from php -i below.

apc

APC support => Emulated

apcu

APCu Support => disabled
CommentFileSizeAuthor
#4 drupal8.opcodecache-apcu.patch1.14 KBsun
#1 2229781.1.patch999 bytesalexpott

Comments

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new999 bytes

Simplest fix is just to check if the apc_delete_file() exists.

catch’s picture

Status: Needs review » Reviewed & tested by the community
sun’s picture

Oh wow... What a nice prime example of how a convenience backwards-compatibility layer can backfire!

Btw, given the slightly bogus error message, I wonder whether the function calls shouldn't actually be prefixed with \ ?

sun’s picture

StatusFileSize
new1.14 KB

Quickly did so.

  • Commit 1adeb2e on 8.x by webchick:
    Issue #2229781 by sun, alexpott: Opcode cache utility breaking cli site...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

I hadn't really seen us doing that \ prefixing of procedural functions before. sun said the reason that would be beneficial is you'd avoid it getting confused and thinking the missing function is in Drupal\Component\Utility\ namespace vs. the root. ("Call to undefined function Drupal\Component\Utility\apc_delete_file()"..) However, since the problem is now fixed I don't think we need that anymore.

Committed and pushed #1 to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.