According to the AWS team response to Problems with PHP APC cache running out of memory, they are not limiting anything intentionally and simply installed stock PHP and stock APC on Elastic Beanstalk:
Elastic Beanstalk is geared toward professional-grade developers whom
we prefer to treat as adults. We're pretty laissez faire about what
you want to do with your environments.
However, I wouldn't be surprised if industry/security best practices are applied regardless, i.e. limiting the altering of respective settings in PHP scripts and/or Apache .htaccess files by default at least, and mcfritzn's response hints towards this as well:
My observations
- ini_set() can NOT be used to influence apc.shm_size and apc.ttl
- the configuration can be controlled by accessing the EC2 instance, edit '/etc/php.d/apc.ini' and reboot Apache using 'sudo
/usr/sbin/apachectl graceful'
- [...]
Accordingly, I suggest you review and alter the Apache/PHP server settings on the instance itself, which should provide respective insights (and potentially a solution on the side).
@before your functions.