In this article we'll discuss how you can speed up your PHP script executions by taking advantage of the APC (Alternative PHP Cache). With PHP APC setup on your server you can automatically have duplicate PHP script executions optimized to run more efficiently.

Because PHP is a dynamic scripting language every time there is a request for a page, instead of the server simply handing that file off to the website visitor requesting it, the server must first parse the PHP code in your script to generate the resulting HTML code to hand off to your visitor's web-browser. This is ideal for web pages that have content that is constantly updated, since each visitor is getting a fresh copy of the page. So for instance if you have your PHP script pulling down data from a database, as soon as there is new data in the database it will automatically be in the generated HTML code for the next visitor requesting that page.

However in most cases this constant need to re-run PHP scripts to get back data that hasn't changed can be taxing on the server. One way to help combat any possible problems with your PHP scripts consuming too many resources, and to help ensure that your website can handle a sudden flood of new visitors, is by implementing what's called opcode (operation code) caching for PHP.

APC for PHP is one of the most widely used PHP opcode caching solutions in use today, and APC is planned to be included in the next release of PHP 6 by default. You can utilize APC on a VPS (Virtual Private Server) or a dedicated server that is running PHP as either DSO or FastCGI. You might want to read about choosing the best PHP handler for your specific needs, and also a more in-depth explanation on what DSO and FastCGI are.

Our system administration department can setup APC on your server for you if this is something that you'd like to take advantage of. We will also be updating this article at a later date to include full instructions for installing APC yourself if you have root access on your server.

 

Like this Article?
MaxPower 2013-03-24 12:54 am
I would love some direction on installing APC on an Inmotion VPS. Need to speed up some Magento sites.

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Jacob Nicholson, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. Parked domain not redirecting to main after Domain Change
  2. Why 404?
  3. Changing the site name in joomla 3.0?

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!