How to install PHP APC extension in WAMP 2.4
Posted by: darkfreak17 (---.84.174-74.dyn.dsl.cantv.net)
Date: June 25, 2015 06:14AM

i am trying to install apc extension for php using wamp 2.4 x64 on windows 7 ultimate, i have downloaded the file in here: [dev.freshsite.pl]
but it doesn't work, what i have to do?

Options: ReplyQuote
Re: How to install PHP APC extension in WAMP 2.4
Posted by: Otomatic (Moderator)
Date: June 25, 2015 10:24AM

Hi,

> wamp 2.4 x64
You need a 64 bit compiled version of apc (not "nts"winking smiley.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: How to install PHP APC extension in WAMP 2.4
Posted by: RiggsFolly (---.as43234.net)
Date: June 25, 2015 10:36AM

When I was looking I could not find a 64bit pre-compiled version of the APC extension. So you might have to install the 32bit WAMPServer. The 64bit version os really for geeks anyway as PHP64bit on windows is still considered Experimental.

But here are my notes from when I last did this:


This assumes you are using a 32bit WAMP even on a 64bit Windows.

It seems rather hard to find a precompiled 64bit version of APC so if you are using the 64bit WAMP maybe installing the 32bit WAMP would be a good idea.

My Environment is WAMPServer 2.4

The version of PHP I tested this with was 5.3.22 which was running under Apache 2.2.26

I got the dll's from [windows.php.net]

and selected php_apc-3.1.10-5.3-vc9-x86.zip for my PHP5.3 Versions

and selected php_apc-3.1.10-5.4-vc9-x86.zip for my PHP5.4 Versions

These are compiled with VC9 (msvc 2008) and match the compiler used to create PHP and APACHE.
If you are using versions of PHP/Apache compiled with other version of MSVC you may need to go looking for someone that has compiled APC with that compiler.

Extract the zips somewhere and then copy the php_apc.dll from the ts (thread safe) folder into your php/ext folder

Edit your php.ini ( using the wampmanager menu links so you get the correct file ) and add this line to the existing section of extension parameters.

extension=php_apc.dll

While in the php.ini add these parameters for apc at the bottom of the ini file
[apc]
; default memory allocation = 32M
apc.shm_size = "32M"
; for dev check for changed code every time so set to "1". "0" for LIVE site.
apc.stat = "1"

This is not actually changing anything as these are actually the defaults, but its a useful place holder for when you decide you want to start fiddling with APC's parameters.

Now to test that the new extension has been loaded, restart apache again using the wampmanager menu, then launch localhost from the menu and click the phpinfo link on the homepage. APC should be the first extension shown in the list of loaded extensions.

Now create a little script to verify apc is working and place it in the \wamp\www folder
filename = test_apc.php
<?php echo '<pre>' . print_r(apc_sma_info(),TRUE) . '</pre>'; ?>

Now run the script from your browser:
'http://localhost/test_apc.php'

You should see something like this reported:

Array
(
    [num_seg] => 1
    [seg_size] => 33554368
    [avail_mem] => 7396512
    [block_lists] => Array
        (
            [0] => Array
                (
                    [0] => Array
                        (
                             => 608
                            [offset] => 25985176
                        )

                    [1] => Array
                        (
                             => 6696
                            [offset] => 26108536
                        )

                    [2] => Array
                        (
                             => 11912
                            [offset] => 26116296
                        )

                    [3] => Array
                        (
                             => 552
                            [offset] => 26011544
                        )

                )

        )

)


Now there is a nice little tool that comes with php_apc called apc.php which does not seem to get distributed with the pre compiled versions of php_apc that I have found but you can get it from here [pecl.php.net]. This is the source code for APC but in the source code is a file called apc.php. Extract that and put it into your \wamp\www folder. Now you can use this by launching 'http://localhost/apc.php' and get all sorts of stats back from your APC Cache.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.