Home | Mirror | SearchITEYE 博客 | OSChina 博客 | 51CTO 博客

第 19 章 PECL :: The PHP Extension Community Library

目錄

19.1. php-apc - APC (Alternative PHP Cache) module for PHP 5
19.1.1. 編譯安裝 APC Cache
19.2. PHP Memcache
19.2.1. pecl
19.2.2. apt-get
19.2.3. example
19.3. php5-gd - GD module for php5
19.4. Database Extensions
19.4.1. sqlite
19.4.2. mysqli
19.4.3. MongoDB
19.4.4. php-redis.x86_64 : Extension for communicating with the Redis key-value store
19.4.4.1. pecl 安裝
19.4.4.2. yum安裝
19.4.4.3. 源碼編譯安裝
19.4.4.4. 配置 redis.ini
19.4.4.5. Session 配置
19.4.5. php5-pgsql - PostgreSQL module for php5
19.4.6. PHP connect SQL Server under unix like
19.4.7. MySQL
19.4.8. oracle
19.5. xmlrpc
19.6. openssl
19.7. mcrypt
19.8. mhash
19.9. simplexml
19.10. ionCube
19.11. ZendOptimizer
19.12. zip
19.13. pcntl
19.14. mbstring
19.15. Suhosin
19.16. freetype
19.17. XCache
19.17.1. apt-get
19.17.2. make
19.18. XHProf
19.19. Xdebug
19.19.1. Webgrind
19.19.2. WinCacheGrind
19.20. UploadProgress
19.21. msgpack
19.22. iconv
19.23. imagick
19.24. sysvmsg

19.1. php-apc - APC (Alternative PHP Cache) module for PHP 5

		
$ apt-cache search php-apc
php-apc - APC (Alternative PHP Cache) module for PHP 5

$ sudo apt-get install php-apc

echo "apc.enabled = 1
apc.shm_size = 128
apc.shm_segments=1
apc.write_lock = 1
apc.rfc1867 = On
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
apc.slam_defense = Off
" >> /etc/php5/conf.d/apc.ini
		
		
# php -r 'phpinfo();' | grep apc
PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Command line code on line 1
Additional .ini files parsed => /srv/php-5.4.15/etc/conf.d/apc.ini
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 => 32M => 32M
apc.shm_strings_buffer => 4M => 4M
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
		

19.1.1. 編譯安裝 APC Cache

例 19.1. php apc cache

pecl install

/usr/local/php/bin/pecl install apc
				

php.ini

				
extension_dir = "/usr/local/php-5.3.3/lib/php/extensions/"
extension = apc.so