200-710 · Question #101
Which php.ini setting is usually required to use an opcode cache?
The correct answer is B. zend_extension. zend_extension is required because opcode caches (like OPcache) operate at the Zend engine level - they intercept and cache compiled bytecode before PHP's normal execution flow. This deep engine integration requires zend_extension rather than the standard extension loader, so…
Question
Options
- Aextension
- Bzend_extension
- Coptimizer
- Ddl
How the community answered
(30 responses)- A7% (2)
- B70% (21)
- C20% (6)
- D3% (1)
Explanation
zend_extension is required because opcode caches (like OPcache) operate at the Zend engine level - they intercept and cache compiled bytecode before PHP's normal execution flow. This deep engine integration requires zend_extension rather than the standard extension loader, so in php.ini you'd write zend_extension=opcache.so (Linux) or zend_extension=php_opcache.dll (Windows).
Why the others are wrong:
- A.
extensionloads ordinary PHP userland extensions (e.g.,curl,pdo). These run on top of the Zend engine, not inside it - too shallow for an opcode cache. - C.
optimizeris not a validphp.inidirective; it's often confused with legacy products like "Zend Optimizer," but it doesn't load anything. - D.
dlis a PHP runtime function, not aphp.inisetting, and it's deprecated - it was never the right tool for opcode caches.
Memory tip: Associate the Z in Zend_extension with Zero - opcode caches work at ground zero (the engine core), so they need the Zend-level hook. If it touches the engine itself, reach for zend_extension.
Topics
Community Discussion
No community discussion yet for this question.