May i use php accelerator with share hosting?

Hello officer
May i use a php accelerator in my share hosting?
Such as eAccelerator,memcached or apc
Thanks for your help

It is possible to enable PHP opcode caching extensions (e.g, XCache and APC) under shared hosting, but I wouldn’t recommend it. They will often increase the memory usage of PHP to the point that you will start running into resource limits, causing your application to fail.

Keep in mind that caches are only useful if you are running PHP as FastCGI. If you have PHP running as CGI, the cache gets thrown out for every request, so it will just slow you down.

Memcached will not work on shared hosting.

I know this is an old post, but if I’ve got php 5.6 fastcgi running default. Drupal prefers opcache to be running. I should be able to change some settings in ~/.php/5.6/phprc, right?

I wasn’t able to find a recipe for this in the Wiki. Can you point me to a link?



We do not recommend running opcode caches on shared hosting. Due to the way PHP is configured on shared hosting, opcode caches will experience a low hit rate, and the increased memory footprint of the cache will increase the risk that your processes will exceed memory limits and be killed.

Opcode caches will perform much better on VPS or dedicated servers.

Andrew, thanks for your reply. As you suggest, OPCache settings are not showing in the phpinfo listing. But as you said in your first reply above, it could actually help for fastcgi. So, why does my phpinfo file show ‘–enable-opcache’ in the “Configure Command” section?

That text only means that, when we compiled that version of PHP, we instructed it to also build the OPcache extension. It does not mean that OPcache is enabled on your domain.