I am trying to install APC on a gentoo with php 5.2 Here teh full command i Lanched:
mkdir /home/APC-php
cd /home/APC-php
wget http://pecl.php.net/get/APC
tar -xzvf APC
cd APC-3.1.9
/usr/local/php5/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php5/bin/php-config
make
make test (i think almost everything failed here)
make install
/etc/init.d/httpd restart
The make install
command showed
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/
Installing header files: /usr/local/php5/include/php/
When I did after make, make test
the output was:
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
APC: apc_store/fetch with strings [tests/apc_001.phpt]
APC: apc_store/fetch with objects [tests/apc_002.phpt]
APC: apc_store/fetch with objects (php pre-5.3) [tests/apc_003.phpt]
APC: apc_store/fetch with bools [tests/apc_004.phpt]
APC: apc_store/fetch with arrays of objects [tests/apc_005.phpt]
APC: apc_store/fetch reference test [tests/apc_006.phpt]
APC: apc_inc/apc_dec test [tests/apc_007.phpt]
APC: apc_cas test [tests/apc_008.phpt]
APC: apc_delete_file test [tests/apc_009.phpt]
APC: apc_store/fetch/add with array of key/value pairs. [tests/apc_010.phpt]
APC: bindump user cache [tests/apc_bin_001.phpt]
APC: bindump file cache part 1 [tests/apc_bin_002.phpt]
APC: APCIterator general [tests/iterator_001.phpt]
APC: APCIterator regex [tests/iterator_002.phpt]
APC: APCIterator chunk size [tests/iterator_003.phpt]
APC: APCIterator regex & chunk size & list [tests/iterator_004.phpt]
APC: APCIterator delete [tests/iterator_005.phpt]
APC: APCIterator formats [tests/iterator_006.phpt]
APC: APCIterator Overwriting the ctor [tests/iterator_007.phpt]
=====================================================================
I already added extension=apc.so
in /usr/local/lib64/php5/php.ini
The extension_dir is extension_dir = "./"
To make apc loaded I had to put the apc.so file in my www directory. Now phpinfo(); says it's loaded.
The problem is that apc_store doens't effectively store the data between requests.
$bar = 'BAR';
apc_store('foo', $bar);
var_dump(apc_fetch('foo'));
Within one request this work.
Now If i try to do a var_dump(apc_fetch('foo'));
on another request it prints:
bool(false)
It is like APC isn't running in background but it starts only for each requests
Isn't this bounty worth the question? :(