转自:http://blog.sina.com.cn/s/blog_5e7987700100dgxh.html

 FreeBSD下安装APC

FreeBSD7.1的Ports里APC还是3.0.19,正式版已经发行到3.1.2了;

安装过程:

安装APC

    cd /usr/ports/www/pecl-APC/; make install clean

make的选项全部选了

安装完毕后,提示:

    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

    Then restart your web server and consult the output of phpinfo().
    If there is an informational section for APC, the installation was
    successful.
    ************************************************************************
    ===>   Registering installation for pecl-APC-3.0.19
    ****************************************************************************

    The following line has been added to your /usr/local/etc/php/extensions.ini
    configuration file to automatically load the installed extension:

    extension=apc.so

在php.ini增加:

    apc.enabled=1
    apc.shm_segments=1
    apc.shm_size=128
    apc.ttl=300
    apc.user_ttl=300
    apc.num_files_hint=1024
    apc.mmap_file_mask=/tmp/apc.XXXXXX
    apc.enable_cli=1

新增 apc.conf.php

    defaults(’ADMIN_USERNAME’,’admin’);
    defaults(’ADMIN_PASSWORD’,’xxxxxx’);

重启apache,查看phpinfo;