Added
A production team deploys a PHP application to several Linux web servers. Requests show high CPU use from repeatedly compiling the same PHP files, but the application code and request behavior must remain unchanged. The servers have limited disk space, and the team needs a standard PHP feature that caches compiled bytecode in shared memory. Which action is the best fit?
OPcache is PHP's bytecode cache and keeps compiled scripts in shared memory when enabled for the web SAPI. Sizing its shared-memory allocation for the codebase addresses capacity without changing application behavior. APCu is a user cache, not a replacement for OPcache's compiled-script cache. file_cache_only selects a disk file cache and conflicts with the shared-memory requirement, as well as the disk constraint. The realpath cache stores path resolution information, not compiled bytecode.