APC installed but not working

Claudio

Well-known member
I follow this guide:http://stevejenkins.com/blog/2011/08/how-to-install-apc-alternative-php-cache-on-centos-5-6/

The install was successful with no errors, but when I made the test (Build complete.
Don't forget to run 'make test'.), I got this error:

============================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 45
---------------------------------------------------------------------

Number of tests : 25 19
Tests skipped : 6 ( 24.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 19 ( 76.0%) (100.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 1 seconds
==============================================

==============================================
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]
====================================================

You may have found a problem in PHP.
So, I dont understand how can I solve this and make APC work

any idea?
 

Slavik

XenForo moderator
Staff member
Looks simply like you've not installed it correctly? did you add the apc edits directly into php.ini or loading via extension?
 

Claudio

Well-known member
did you add the apc edits directly into php.ini or loading via extension?
I don´t understand how to do that step
Next, if you have an /etc/php.d/ directory on your server, create a file called/etc/php.d/apc.ini to store all your configuration settings (if it already exists, you can just edit the existing one). If you don’t have an /etc/php.d/ directory, you can add these configuration settings to your existing php.ini file, which is usually located at /etc/php.ini.
Is it necessary?
I dont have that directory, I need to create it but I don´t know which is the command to edit php.ini file
 

Slavik

XenForo moderator
Staff member
I don´t understand how to do that step

Is it necessary?
I dont have that directory, I need to create it but I don´t know which is the command to edit php.ini file
Yes, without loading the module into php it will not run.

Open up /usr/local/lib/php.ini

Copy in that large block of code on that guide, save and restart httpd
 

Claudio

Well-known member
Do you have pecl installed?
If you do, it should be as simple as

pecl install apc
echo "extension=apc.so" > /etc/php.d/apc.ini
service httpd restart
it asks:

Enable internal debugging in APC [no] :
Enable per request file info about files used from the APC cache [no] :
Enable spin locks (EXPERIMENTAL) [no] :
Enable memory protection (EXPERIMENTAL) [no] :
Enable pthread mutexes (default) [yes] :
Enable pthread read/write locks (EXPERIMENTAL) [no] :
Do I should press enter in each message?
 

Slavik

XenForo moderator
Staff member
open up your php.ini file (at /usr/local/lib/php.ini)

at the bottom copy in

Code:
extension=apc.so
apc.enabled=1
apc.shm_size=30
save then restart httpd
 

Claudio

Well-known member
open up your php.ini file (at /usr/local/lib/php.ini)

at the bottom copy in

Code:
extension=apc.so
apc.enabled=1
apc.shm_size=30
save then restart httpd
ready :)

thank you very much
pd: will work the same as using only apache? because I have also installed NginxCP
 

Claudio

Well-known member
thanks very kind, now its time to configure it using Floris guide :D
any security advice for my php.ini config?
 
Top