cd /usr/ports/www/pecl—APC/
make install clean
просмотр постинсталляционных сообщений
pkg_info —xD pecl—APC
You may edit /usr/local/etc/php.ini to change this variables:
apc.enabled=»1″
^^^ -> Default value
apc.shm_size=»30″
^^^^ -> Default value
* More information on /usr/local/share/doc/APC/INSTALL
просмотр файлов,установленных пакетом pecl-APC
pkg_info —xL pecl—APC-3.1.14_1
Проверка поддержки apc php
php —m | grep apc
apc
cp /usr/local/share/doc/APC/apc.php /usr/local/www/apache22/data/
/usr/local/www/apache22/data/ — это корень моего сайта по умолчанию
Проверка состояния APC
http://<ip-adress>/apc.php
Просмотр текущих параметров
php -i | grep apc
apc
apc.cache_by_default => On => On
apc.canonicalize => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On
apc.file_md5 => Off => Off
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.lazy_classes => Off => Off
apc.lazy_functions => Off => Off
apc.max_file_size => 1M => 1M
apc.mmap_file_mask => no value => no value
apc.num_files_hint => 1000 => 1000
apc.preload_path => no value => no value
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.serializer => default => default
apc.shm_segments => 1 => 1
apc.shm_size => 64M => 64M
apc.slam_defense => On => On
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 0 => 0
apc.use_request_time => On => On
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 0 => 0
apc.write_lock => On => On
По умолчанию выделаяется 32 Mb
Для увеличения размера памяти добавляем в /usr/local/etc/php.ini
nano /usr/local/etc/php.ini
apc.shm_size=»64M»
Для применения настроек перезапускаем Apache
/usr/local/etc/rc.d/apache22 restart