1

I am trying to install APC on my vps. I followed these instructions which seemed to be found on several websites:

yum install php-pear php-devel httpd-devel pcre-devel gcc make
pecl install apc

Next there is the following command which failed:

echo "extension=apc.so" > /etc/php.d/apc.ini

This is because there was no php.d directory. So I did two things 1) I created the php.d directory and added a apc.ini file with one line:

extension=apc.so

And I also added that line to the php.ini file in

/usr/local/lib

I restarted apache:

/sbin/service httpd restart

and the APC configuration info still does not show up in my php.ini file.

I even added the extension to the website's local php.ini file. What am I missing here?

Thanks.

user1253073
  • 374
  • 2
  • 6
  • 26

1 Answers1

2

You need to find where your php.ini file is and add the config from the apc.ini file to it. This is a copy from the apc.ini file in w3-total-cache

extension = apc.so
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 32M
apc.optimization = 0
apc.num_files_hint = 4096
apc.ttl = 7200
apc.user_ttl = 7200
apc.gc_ttl = 0
apc.cache_by_default = 1
apc.filters = ""
apc.mmap_file_mask = "/tmp/apc.XXXXXX"
apc.slam_defense = 0
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 10M
apc.stat = 0
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
;apc.rfc1867 = 0
;apc.rfc1867_prefix = "upload_"
;apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
;apc.rfc1867_freq = 0
apc.localcache = 0
apc.localcache.size = 2048
apc.coredump_unmap = 0
apc.stat_ctime = 0
Tunji
  • 187
  • 2
  • 11