Click here to Skip to main content
Click here to Skip to main content

Tagged as

PHP accelerations: How to configure Alternative PHP Cache (APC) on Windows

, 10 Jan 2013
Rate this:
Please Sign up or sign in to vote.
APC is a very popular PHP extension to optimize PHP developments.

Introduction

According to the Wikipedia, accelerations of PHP means to cache the compiled bytecode of PHP scripts to avoid the overhead of parsing and compiling source code on each request. I have used Alternative PHP Cache (APC) to optimize my PHP developments as APC is a fully free and open source (PHP license) framework used for optimizing PHP codes and caches data and compiled code from the PHP bytecode compiler in shared memory.

You may collect the full source of APC from http://pecl.php.net/package/APC.

Occasionally I have been questioned about the procedure to configure APC on Windows platform and the purpose of this submission is how to configure APC on Windows step-by-step avoiding the problems generally found.

Environment  

I have used following versions here to test the complete configuration,

  1. APV 3.1.14 beta 
  2. WAMP server 2.2 containing PHP 5.3.13, Apache 2.2.22 and MySQL 5.5.24
  3. Windows 7 (64-bit) 

Configuration Steps

  1. At first, I have setup my WAMP Server on a location as E:\wamp. 
  2. Now to install APC, I have to copy php_apc.dll to the ext directory. On my system, the location is E:\wamp\bin\php\php5.3.13\ext\

    It's important to excerpt here that you will get the binaries of all versions of APC from the location as
    http://dev.freshsite.p/php-accelerators/apc.html

    As well as, you’ll collect the proper documentation on APC from
    http://www.php.net/manual/en/book.apc.php 
  3. Now open the initialization (php.ini) file from the location as E:\wamp\bin\php\php5.3.13\php.ini or you may follow the way depicted in following figure.


    Now just append following two lines at the very bottom of this initialization file as following figure.
    apc.enabled = 1
    apc.stat = 1

  4. Save the file php.ini and close it.
  5. Now restart the WAMP web server.
  6. Now copy the file apc.php from the archive APC-3.1.14.tgz after extraction, collected from the location http://pecl.php.net/package/APC and paste it to the folder accessible from web server. In my example it is E:\wamp\www\ 
  7. Now open your preferred browser and write on address bar as http://localhost/apc.php and enjoy the environment to improve the performance of your applications developed in PHP.

Conclusion  

As APC is a very popular PHP extension to accelerate PHP development, so you must capable to develop a very large scale of PHP development using it in Windows platform comparing same of Linux/Unix environment.

History

Initial post: 10th January, 2013.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


Comments and Discussions

 
QuestionNot working Pinmemberbleuscyther31-Jan-13 10:20 
Questionmissing an l in the url for the dll Pinmemberbleuscyther31-Jan-13 9:56 
the correct URL: http://dev.freshsite.pl/php-accelerators/apc.html[^] . Missing the l Smile | :) .
Thank you for the post

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 10 Jan 2013
Article Copyright 2013 by Zamshed Farhan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid