Install APC on Windows

后端 未结 6 1529
悲哀的现实
悲哀的现实 2021-02-04 05:17

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 in         


        
相关标签:
6条回答
  • 2021-02-04 05:53

    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.

    0 讨论(0)
  • 2021-02-04 05:53

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

    0 讨论(0)
  • 2021-02-04 05:55

    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.

    0 讨论(0)
  • 2021-02-04 06:00

    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/

    0 讨论(0)
  • 2021-02-04 06:00

    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.

    0 讨论(0)
  • 2021-02-04 06:09

    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

    0 讨论(0)
提交回复
热议问题