Nothing Special   »   [go: up one dir, main page]

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

compileOpcache fails with php8.1 #1183

Closed
ravermeister opened this issue Mar 26, 2023 · 3 comments
Closed

compileOpcache fails with php8.1 #1183

ravermeister opened this issue Mar 26, 2023 · 3 comments
Assignees

Comments

@ravermeister
Copy link
Contributor

Hi, I installed the latest movim from the master branch as explained here, my PHP Version is:

www-data@machine:/usr/share/movim$ php -v
PHP 8.1.17 (cli) (built: Mar 16 2023 14:37:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.17, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.17, Copyright (c), by Zend Technologies

However somehow the compileOpcache is not running properly. I always get the following error log when starting the damon.php. I found out that the error reporting is disabled for the opcache compile process.
To get the Error I changed the function temporarely from:

/**
 * Compile main files in Opcache
 */
function compileOpcache()
{
    error_reporting(0);
    foreach (listOpcacheCompilableFiles() as $file) {
        opcache_invalidate($file, true);
        yield @opcache_compile_file($file);
    }
    error_reporting(1);
}

to

/**
 * Compile main files in Opcache
 */
function compileOpcache()
{
//    error_reporting(0);
    foreach (listOpcacheCompilableFiles() as $file) {
        opcache_invalidate($file, true);
//        yield @opcache_compile_file($file);
        opcache_compile_file($file);
    }
//    error_reporting(1);
}

and did a manual compile via php daemon.php compileOpcache. This is the output: https://termbin.com/1e4e

@edhelas edhelas self-assigned this Mar 26, 2023
@edhelas
Copy link
Member
edhelas commented Mar 26, 2023

Looks like its linked with php/php-src#8846

@edhelas
Copy link
Member
edhelas commented Mar 27, 2023

I don't a a clean solution for it yet. Do not hesitate to comment back if you have an idea.

@ravermeister
Copy link
Contributor Author

according to the comment in opcache_invalidate
it will trigger a recompile. so wouldn't it be cleaner to check if the file is already in cache via opcache_is_script_cached, and if so invalidate and otherwise compile?

I mean s.th like this:

/**
 * Compile main files in Opcache
 */
function compileOpcache()
{
    error_reporting(0);
    foreach (listOpcacheCompilableFiles() as $file) {
        if (opcache_is_script_cached($file)) {
                opcache_invalidate($file, true);
        } else {
                yield @opcache_compile_file($file);
        }
    }
    error_reporting(1);
}

@edhelas edhelas closed this as completed in d6a65a0 Apr 3, 2023
edhelas added a commit that referenced this issue Apr 3, 2023
Fix #1183  compileOpcache fails with php8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants