Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install APC on Windows

Tags:

php

apc

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

I used

pecl install apc

I got

C:\PHP>pecl install apc
downloading APC-3.0.19.tgz ...
Starting to download APC-3.0.19.tgz (115,735 bytes) ............
done: 115,735 bytes 47 source files, building
WARNING: php_bin c:\php\php.exe appears to have a suffix \php.exe, but config
    variable php_suffix does not match running: msdev APC.dsp /MAKE "APC - Release"
ERROR: Did not understand the completion status returned from msdev.exe.
like image 631
Jiew Meng Avatar asked Mar 13 '10 08:03

Jiew Meng


3 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/

like image 179
Pascal MARTIN Avatar answered Oct 21 '22 05:10

Pascal 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.

like image 42
lubosdz Avatar answered Oct 21 '22 06:10

lubosdz


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.

like image 3
kta Avatar answered Oct 21 '22 07:10

kta