Domanda

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?

È stato utile?

Soluzione 2

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
                        )

                )

        )

)

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top