How can I install APC on Windows? I am using PHP 5.3, Windows 7 x64.

There is a bug related to memprotect (The best solution is to go for 32bits, unless you want to recompile apc yourself.

I used

I got

Jiew MengJiew Meng

6 Answers

Installing an extension with the pecl command means :

  • downloading the sources
  • compiling them

And, generally speaking, a windows machine doesn't have what's required to compile software like PHP and/or PHP extensions.


A better / easier solution, in your case, would probably be to find a pre-compiled .dll of the extension, that matches your system and your version of PHP.

With a bit of luck, maybe one of the versions provided on http://downloads.php.net/pierre/ could be OK ?
(It's what kind of acts as replacement of the old pecl4win, until the extensions for windows are available on windows.php.net)

For more informations about which version you should use, take a look at the Which version do I choose? section, in the left side-bar of http://windows.php.net/

Pascal MARTINPascal MARTIN

It is not really important, whether you are running Windows 32-bit or 64-bit version. What matters is what Apache (webserver) version you have installed (32/64). Since lots of PHP extensions (like APC) are not available for 64-bit systems, most common setup is as follows:

  • Operating system 32 or 64-bit (not really important). Apache 32-bit will run easily on Windows 64-bit. The difference is, that for 32-bit apache you MUST install PHP 32-bit. Once you install 64-bit PHP, you may find difficult to install some extensions - there are almost no extensions available for 64-bit PHP platform.

  • therefore your webserver should be 32-bit if you care about special extensions, like APC, Imagick etc... Also you need to know if your apache is thread safe (TS) or not thread safe (NTS) and whether it has been compiled in Visual Studio 6 (VC6) or newser Visual Studio 2008 (VC9). You will easily find all this info from phpinfo() function.

  • as for the APC, some nice compilation for Windows are available from http://dev.freshsite.pl/php-accelerators/apc.html.

lubosdzlubosdz

For php 5.3 you use php.net/pierre/php_apc-3.1.10-5.3-vc9-x86.zip.

Download it and copy php_apc.dll to your php ext directory. (I choose the file under ts I have thread safe php installation. There is also an apc dll file for non thread safe.)

Add extension=php_apc.dll into your php.ini file

Restart your web server

Run phpinfo() to see if it's installed or not.

I am using php 5.4 and I downloaded php.net/pierre/php_apc-3.1.10-5.4-vc9-x86.zip and its working fine.

Hope this will help mate.Good luck.

ktakta

Also, make sure that the compiled version from here http://downloads.php.net/pierre/matches your php version, otherwise the extension will not load (php v. 5.2.17 requires php_apc.dll v 5.2.17.17 - which doesn't seem to be available as of this writing - I had to downgrade the php version to play with apc).

Another point, pierre's zip packages, at least the one I downloaded, did not include the management script. you can get it from here: http://pecl.php.net/package/APC - select the version you downloaded, then navigate to Browse Source, then find your version in the 'tags' folder. the apc.php script should be there.

RaivoRaivo

There's no available version for php > 5.4.I'm using APCu instead. Just download the dll and reference it in php.ini.

devilciusdevilcius

This website offers updated dll and installers for Apache, PHP and APC compiled to work on windows 64 bit. I've been using it for a while and it works fine. You could an APC version compatible with PHP 5.3.22 here

Ahmad AlfyAhmad Alfy
Accelerator

Not the answer you're looking for? Browse other questions tagged phpapc or ask your own question.

I am trying to install PHP accelerator like apc for a symfony project .The problem is that the apc is not appearing in localhost/?phpinfo=1, however it does appear on wamp>php>extensions menu tray with options php_apc enabled.And also when i try localhost/test.symfony.com/web/config.php , it seems that symfony project does not detects the apc.

I have trying to resolve this problem for the past 3 days :( .

Here are my steps that i have made to install and enable apc.dll

1.In the folder of the extensions i have placed the apc.dll C:wampbinphpphp5.4.3ext

I have downloaded the apc.dll from http://dev.freshsite.pl/php-accelerators/apc.html for the version APC 3.1.9 for PHP 5.4 vc9 (Win7/2008) as per my configuration

2.I have set up the extension for the dll in php.ini as below in Dynamic Extensions extension=php_apc.dll

With

and in the Module Settings section i have placed the following:-

[APC]

apc.enabled = 1

apc.shm_segments = 1

apc.shm_size = 128M

apc.max_file_size = 10M

apc.stat = 1

3.Restart wampserver

MY php info:

Compiler -MSVC9 (Visual C++ 2008)

How

Architecture -x64

Thread Safety -enabled

apache version -2.4.2

php version -5.4.3

How To Install Apc Srt5kxli

OS -window 7

Thanks you for kind reply :)

user1771290

closed as off topic by nickb, John Conde, SilentGhost, prodigitalson, LittleBobbyTablesOct 24 '12 at 14:12

Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

Posted on  by  admin