PHP opcache refresh when deploying using symlinks in nginx/php-fpm environment

So…

…and you experience WTF case when your content somehow seems not to be refreshed despite calling opcache_reset().

Reasons and solutions are described in the ZendOptimizerPlus issue #126.

It can be solved by using $realpath_root in the nginx config:

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;

It worked for me and huge thanks go to Vitaly Chirkov.

  1. by sobstel • November 2014