Skip to content

Old PHP code remains active after deploying capistrano

Capistrano uses symlinks to point to the active version of your code code. The PHP opcache does not follow those symlinks on every request, which can cause the old version of your code to remain active after a deploy. In the worst case, it may even become a mix of two versions.

The quickest solution is to clear the opcache as part of your deploy process:

cachetool opcache:reset --fcgi=/usr/local/multi-php/ACCOUNT/run/ACCOUNT.sock

Replace ACCOUNT with the name of your account in Sock. This is also the username you use to log in to the server.

In documentation you will regularly find a reference to php cachetool.phar, you can replace that on Combell-SRE servers with cachetool.