Greetings,
I'm starting development to move our antique association website from PHPnuke to D8
and I have this error just after entering Database info>>>>
Fatal error: Call to undefined function Drupal\Component\Utility\opcache_invalidate() in /home/myvibz/nilo/core/lib/Drupal/Component/Utility/OpCodeCache.php on line 30
I just don't understand. I've follow all intructions, videos,seminaires,etc....

PHP version: 5.4/5.5/5.6 (I've tried them all)
Server: Apache 2.2.22 (shared hosting OVH pro)

Any help is welcome. Thks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Postponed (maintainer needs more info)

That's weird, why would you have the extension enabled but not that function? Try to ask your hoster.

Also, please keep in mind that Drupal 8 is in beta phase and does not yet have an upgrade path. Do *not* use it for a production site just yet.

makheda’s picture

Tks for the advices. I'm not upgrading. This is an old PHPnuke website built in 2007. And that's my usual procedure with drupal: I start an early dev build on the beta stage.
And I have no idea which extension you're talking about. Could you give me more light.
As a matter of fact, I've contacted the support to know if there's any incompatibility with the server settings.
knowing what should be enabled to avoid this error could help them to solve this issue. Thks again.

Berdir’s picture

Title: Installation Fatal error: Call to undefined function » Installation Fatal error: Call to undefined function opcache_invalidate()

I meant a list of php extensions

The code that is failing for you checks if the "Zend OPcache" extension is available, which it apparently is, then calls opcache_invalidate(), which is defined by that extension, which then fails?

Maybe your hoster has a custom, old version of Zend Opcache? According to http://php.net/opcache_invalidate, it is available since version 7.0.

you could for example run phpinfo() in a test file, then look for something like this and post it here:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans

I guess we can fix this by explicitly checking for the function, but I would like to know what version you have available anyway. If it is older than 7.0, I suggest you contact your hoster about this and give him a link to this issue. I think they should update that extension.

makheda’s picture

here is the phpinfo of the cluster where my websites are hosted:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

So it seems up to date. I've reported your explaination and provided them a link to this node.

Berdir’s picture

Category: Support request » Bug report
Status: Postponed (maintainer needs more info) » Active
Issue tags: +Novice

Then I really can't say why this happens.

Anyway, changing to a bug report and tagging with novice, if someone wants to try and replace the extension exists check with a function_exists() in core/lib/Drupal/Component/Utility/OpCodeCache.php, that should be trivial.

markpavlitski’s picture

Status: Active » Needs review
FileSize
628 bytes

Patch against latest 8.x-dev attached.

Berdir’s picture

Looks good, comment should follow coding standards, meaning end with a ., and we should try to make it a real sentence. Something like, "If Zend OPCache is available, invalidate that file."

markpavlitski’s picture

@Berdir thanks for the suggestion! Corrected patch attached.

makheda’s picture

Status: Needs review » Fixed

Install done .
what ever funny I find on my way, I'll let know.
Tks you both.

markpavlitski’s picture

Status: Fixed » Needs review

Reopening so the patch can be reviewed for other users.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Fixed is used when a patch is committed to core. (It would be correct for a support request, but the fact that it does require a patch
proves that it is no longer a support request :)).

The correct status for this is Reviewed & tested by the community. That means that one of the core committers will evaluate if this can be committed to core, I'm not 100% sure myself, but let's bring this issue to their attention.

We should also reference this in the original issue that is currently RTBC as a possible problem. Had to dig it up, #779482: Installation failure when opcode cache is enabled, will comment there.

markpavlitski’s picture

Adding related issue.

  • catch committed 8b4fcd2 on 8.0.x
    Issue #2408533 by markpavlitski: Installation Fatal error: Call to...
catch’s picture

Status: Reviewed & tested by the community » Fixed

I could see this happening on a PHP install with disable_functions.

Committed/pushed to 8.0.x, thanks!

@makheda would you mind checking php.ini/phpinfo() and see if that's why opcache_invalidate() isn't available?

makheda’s picture

I confirm: PHP 5.6.2 with disable_functions
I'm the one who thanks you all for the amazing work done.

Status: Fixed » Closed (fixed)

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