The title mostly covers the whole problem: I have a setup where I use a link /srv/www/latest
to point to the latest version of a project, which is deployed to a directory in /srv/www
. /srv/www
is a directory on the host mounted into a container that runs Apache+php-fpm. But when I change the target of the link, the path from which Apache actually delivers remains unchanged.
In quite a few places this problem is discussed and mostly explained by the use of php-fpm (apache not reading updated symlink) and/or how the PHP opcache works. But at least in my case, the problem persists
- when I clear the opache
- when I disable the opache
- when I set opcache.revalidate_path = 1
- when I execute
clearstatcache(true)
and - when I kill and restart the php-fpm master process from inside the container
Only restarting the whole container makes the new link target active.
I have run out of ideas. Do you have any? PHP version is 7.4.30.