APC for wampserver 2.4
Asked Answered
R

2

5

After 3 hours of searches and differents failed tries, I'm asking help here .. .:(

My configuration:

PHP 5.4.12

Compiler MSVC9

OS: W7 Home premium edition service pack 1

Architecture: x64

Apache: 2.4.4

I've tried many php_apc.dll without success. Is someone found the right one to use or any good alternative to APC?

Rhinology answered 20/2, 2014 at 2:11 Comment(9)
Define "without success"? You might try apcu, which offers the same data-caching capabilities as apc, but does not offer opcode caching. If you ever upgrade to PHP 5.5, apc won't work, anyway, so this would simplify your life.Soble
@EdCottrell I mean or the wamp icon was green but no apc displayed in the phpinfo() or the wamp icon was blocking to orange. This is my definition ;) apcu ? I find many links, is it a dll like the apc one?Rhinology
Did you actually test any APC functions? Yes, APCU is a dll just like APC. I have it working on Win7 with PHP 5.5 and Apache 2.4.Soble
Do you have a link to it please?Rhinology
pecl.php.net/package/APCuSoble
199.180.97.218:8080 Still nothing in the phpinfo() , I took the 5.5 Thread Safe (TS) x64 but I have 5.4.12 could it be an issue? There is no x64 for the 5.4 versions.Rhinology
There's really not enough info here to diagnose your problem. You haven't posted any config files (php.ini or otherwise), so it's impossible to tell why it isn't showing in phpinfo().Soble
This is my php.ini: pastebin.com/ctbtx1pHRhinology
@EdCottrell Finally I've installed xcache. It's really easier than APC(u) . Each time I have to reinstall my pc, I have headaches with the apc ... Thanks btw !!Rhinology
A
5

Installing APC seems fairly simple. I just did it in 10 minutes.

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 HERE

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

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 ilnk 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
                        (
                            [size] => 608
                            [offset] => 25985176
                        )

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

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

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

                )

        )

)
Anklet answered 20/2, 2014 at 15:40 Comment(1)
Thanks for the accept, 6 years, wow, what made you accept the answer now :)Anklet
D
12

PHP APC extension for PHP 5.3x to PHP 5.4 and PHP APCu extension for PHP 5.5x

APC installation:

Step 1:

Download APC dll file for PHP 5.3x to 5.4

Step 2:

Extract zip and rename with php_apc.dll

Step 3:

Copy and paste in YOUR_DIR:\wamp\bin\php\php_YOUR_PHP_VER_5.3x_OR_5.4\ext

Step 4:

Enable apc from php.ini

Open php.ini file

YOUR_DIR:\wamp\bin\apache\apache_YOUR_APACHE_VER\bin\php.ini

extension=php_apc.dll

Put above line in php.ini file

OR (Base on your configuration)

YOUR_DIR:\wamp\bin\php\php_YOUR_PHP_VER_5.3x_OR_5.4\php.ini

extension=php_apc.dll

Put above line in php.ini file

Step 5:

Restart Apache



APCu installation for PHP 5.5x:

Step 1:

Download APCu dll file for PHP 5.5x

Step 2:

Extract zip and rename with php_apcu.dll

Step 3:

Copy and paste in YOUR_DIR:\wamp\bin\php\php_YOUR_PHP_VER_5.5x\ext

Step 4:

Enable apc from php.ini

Open php.ini file

YOUR_DIR:\wamp\bin\apache\apache_YOUR_APACHE_VER\bin\php.ini

extension=php_apcu.dll

Put above line in php.ini file

OR (Base on your configuration)

YOUR_DIR:\wamp\bin\php\php_YOUR_PHP_VER_5.5x\php.ini

extension=php_apcu.dll

Put above line in php.ini file

Step 5:

Restart Apache

Differentiate answered 23/9, 2014 at 18:35 Comment(6)
I followed this and working well. But i'm having problem like if i open other application which is not use the apc means this application not opening by wamp server.Intenerate
If i use 2 applications one app using the apc and another one not using apc means, unused apc application not opening in wamp serverIntenerate
@Vinoth, I don't have this type of issue or also I have none apc project but it's working well in wampp. When you want to use none apc apps, you can disable apc. yes, this not a proper solution but in your case do like this might be solve, I guess.Differentiate
yes, currently doing like so in my local system, but if it happens in server means i can't disable apc right.Intenerate
Nope, Also you can disable from your cPanel, if you have an access screencast.com/t/4K4xbe45nch otherwise you have to contact your host provider.Differentiate
i have followed all the steps but still apc doesn't seem to workMarrufo
A
5

Installing APC seems fairly simple. I just did it in 10 minutes.

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 HERE

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

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 ilnk 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
                        (
                            [size] => 608
                            [offset] => 25985176
                        )

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

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

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

                )

        )

)
Anklet answered 20/2, 2014 at 15:40 Comment(1)
Thanks for the accept, 6 years, wow, what made you accept the answer now :)Anklet

© 2022 - 2024 — McMap. All rights reserved.