I found that realpath_cache_get() always empty, I started to figure it out and found out that everything works fine in the cli mode, but when I request it from the web I get an empty array.
From the script: <?php realpath(null); var_dump(realpath_cache_get()); // array(0) {} <?php realpath(null); var_dump(realpath_cache_get()); // array(0) {}
From the console: php -r 'realpath(null); var_dump(realpath_cache_get());' // array(5) {...} php -r 'realpath(null); var_dump(realpath_cache_get());' // array(5) {...}
It is phpinfo() compare completely phpinfo() from the web and cli due to different formats, but the main thing is the same:
ini_get('open_basedir'); // bool(false) ini_get('realpath_cache_size '); // string(5) "2048k" ini_get('realpath_cache_ttl '); // string(3) "120" There is only one version of php on the server:
PHP 5.6.25 (cli) (built: Aug 31 2016 19:17:57) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies When requesting from the web, realpath_cache_get() very rarely skips /etc/php.d/opcache-default.blacklist , but mostly the array is empty.