PHP APC安裝與使用

來源:互聯網
上載者:User

標籤:http   io   使用   ar   strong   檔案   art   問題   sp   

先要解決一下httpd-devel依賴庫問題

yum install cyrus-sasl-devel db4-devel openldap apr apr-util apr-util-devel pcre-devel

手動安裝:

官網 http://cn2.php.net/manual/zh/book.apc.php

下載http://pecl.php.net/package/APC 找最新的

 

#wget http://pecl.php.net/get/APC-3.1.9.tgz

# tar -zxvf APC-3.1.9.tgz
# cd APC-3.1.9
# phpize (生產configure檔案)
# ./configure --enable-apc --enable-apc-mmap --with-apxs

./configure --enable-apc-mmap --enable-apc --enable-apc-filehits
# make
# make install

拷貝添加SO檔案
# cp /usr/local/lib/php/extensions/no-debug-zts-20060613/apc.so /usr/local/php/lib/php/extensions/apc.so
# chmod 755 /usr/local/php/lib/php/extensions/apc.so
修改PHP.INI使之啟動APC模組
修改 php.ini下
extension_dir = “./”
extension_dir = “/usr/local/php/lib/php/extensions”
配置/etc/php.ini 末尾加入
extension=apc.so
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 64M
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 1024
apc.write_lock = On
apc.gc_ttl=3600
apc.ttl=0
apc.mmap_file_mask=/tmp/apc.XXXXXX
重啟apache

#/usr/local/apache2/bin/apachectl restart

 

使用APC

<?php

print_r(apc_cache_info());

?>

PHP APC安裝與使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.