Compile what you need
Performance Tuning PHP
2024-10-11
2
Avoid useless bloat and compile only the extensions you need.
Extensions that are rarely used, should be compiled as shared modules and loaded by the few scripts requiring them.
--disable-all
is your friend.