Skip to content

After reset still referencing wrong files #259

@codedge

Description

@codedge

Hey 👋

I am deploying my site using symlinks. So I have

/var/www/site/
 | - current -> releases/b
 | - releases
    | - a
    | - b

and have this opcache configuration.

# file /etc/php/8.4/fpm/conf.d/10-opcache.ini
opcache.preload_user=nginx
opcache.interned_strings_buffer=16
opcache.validate_timestamps=0
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0

realpath_cache_size=4096K
realpath_cache_ttl=600
# file /etc/php/8.4/fpm/conf.d/991-opcache.ini
opcache.preload = /var/www/site/releases/b/config/preload.php

After every deploy I update the value inside the file 991-opcache.ini and after that I run cachetool opcache:reset --fgi. There is no error. Also the Last restart time reflects the restart when running opcache:status.

Still, I get errors saying

Cannot redeclare class ComposerAutoloaderInitba48b4ad0d523e98af3c08be1e04ca18 (previously declared in /var/www/site/releases/a/vendor/composer/autoload_real.php:5)

which points to the older a release instead of the newer/current b release.

The only thing that helps is to restart my php8.4-fpm process.

Any idea what to do here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions