user26858
user26858

Reputation:

should I add a php APC to my server

A friend has recommended that I install php APC, claiming it will help php run faster and use less memory

sounds promising but I'm a little nervous about adding it to my VPS server

I have one small app that I've built using codeigniter, and several sites that use the popular slideshowpro photo gallery software

could install this break any of the back end code on my sites?

I'm no high tech server guy, but should I give this a try?

Upvotes: 0

Views: 369

Answers (3)

KushalP
KushalP

Reputation: 11206

Depends entirely on your situation.

Is your site unresponsive or slow at the moment? Is this definitely due to the PHP scripts and not any other data sources such as a database or remote API?

If you answered yes to the above, then installing one of the many PHP accelerators out there would be a good shout. As for using less memory, that's largely dependent on your apache/lightppd/nginx config and php.ini variables.

Most PHP accelerators work by converting the (to be) interpreted PHP code into opcode. This is then stored in memory (RAM) for fast access. If you haven't already implemented file-based caching in CodeIgniter then the benefits of installing a PHP accelerator would be noticeable. If you haven't, then I suggest you do that first before moving straight over to (wasting?) spending time trying to install APC manually.

If your site is currently performing well and you're not too confident in your *nix skills then I suggest you try implementing CodeIgniter caching first rather than try messing with what is an already working VPS.

My personal preference is PHP eAccelerator.

Should installing a PHP cache engine not improve your site's performance then I suggest you look at what other factors influence your application. As stated above, these could be: database or API to name a few.

Hope this helps.

Upvotes: 2

timmow
timmow

Reputation: 3625

When a php script is processed, there is a compilation phase, where php converts the source code of the php files into "opcodes". APC simply caches the result of this compilation phase, so it should be safe to turn on.

That said, when making such changes to production code it is always wise to run a regression test to ensure no new issues have been introduced.

Upvotes: 0

clops
clops

Reputation: 5235

APC is basically a cache engine that stores your compiled php scripts on a temp location on your server. Meaning that these do not have to be interpreted every time someone calls your sccript. It is a PHP extension can can safely be turned ON or OFF and it does not affect your actual code. So... do not fear!

Upvotes: 2

Related Questions