{"id":698,"date":"2014-06-13T15:55:05","date_gmt":"2014-06-13T13:55:05","guid":{"rendered":"http:\/\/www.xcep.net\/blog\/?p=698"},"modified":"2014-09-05T23:06:21","modified_gmt":"2014-09-05T21:06:21","slug":"apc-auf-centos-installieren","status":"publish","type":"post","link":"https:\/\/www.xcep.net\/blog\/apc-auf-centos-installieren\/","title":{"rendered":"APC auf CentOS installieren"},"content":{"rendered":"<p>APC ist ein Cache System f\u00fcr PHP (Alternative PHP Cache) und als PECL Modul verf\u00fcgbar. Die Installation auf CentOS wird wie folgt durchgef\u00fchrt:<\/p>\n<pre lang=\"shell\">yum install pcre-devel\r\nyum install php-pecl-apc.x86_64 php-pecl-apc-devel.x86_64\r\n<\/pre>\n<p>Anschlie\u00dfend muss noch eine ini-Datei erstellt werden, in der einerseits die PHP-Extension geladen wird und andererseits Konfigurationen f\u00fcr APC vorgenommen werden k\u00f6nnen.<!--more--><br \/>\nDer Inhalt der (\/etc\/php.d\/)apc.ini Datei sieht folgenderma\u00dfen aus:<\/p>\n<pre lang=\"ini\">; Enable apc extension module\r\nextension = apc.so\r\n\r\n; Options for the APC module version &gt;= 3.1.3\r\n; See http:\/\/www.php.net\/manual\/en\/apc.configuration.php\r\n\r\n; This can be set to 0 to disable APC. \r\napc.enabled=1\r\n; The number of shared memory segments to allocate for the compiler cache. \r\napc.shm_segments=1\r\n; The size of each shared memory segment, with M\/G suffix\r\napc.shm_size=64M\r\n; A \"hint\" about the number of distinct source files that will be included or \r\n; requested on your web server. Set to zero or omit if you are not sure;\r\napc.num_files_hint=1024\r\n; Just like num_files_hint, a \"hint\" about the number of distinct user cache\r\n; variables to store.  Set to zero or omit if you are not sure;\r\napc.user_entries_hint=4096\r\n; The number of seconds a cache entry is allowed to idle in a slot in case this\r\n; cache entry slot is needed by another entry.\r\napc.ttl=7200\r\n; use the SAPI request start time for TTL\r\napc.use_request_time=1\r\n; The number of seconds a user cache entry is allowed to idle in a slot in case\r\n; this cache entry slot is needed by another entry.\r\napc.user_ttl=7200\r\n; The number of seconds that a cache entry may remain on the garbage-collection list. \r\napc.gc_ttl=3600\r\n; On by default, but can be set to off and used in conjunction with positive\r\n; apc.filters so that files are only cached if matched by a positive filter.\r\napc.cache_by_default=1\r\n; A comma-separated list of POSIX extended regular expressions.\r\napc.filters\r\n; The mktemp-style file_mask to pass to the mmap module \r\napc.mmap_file_mask=\/tmp\/apc.XXXXXX\r\n; This file_update_protection setting puts a delay on caching brand new files.\r\napc.file_update_protection=2\r\n; Setting this enables APC for the CLI version of PHP (Mostly for testing and debugging).\r\napc.enable_cli=0\r\n; Prevents large files from being cached\r\napc.max_file_size=1M\r\n; Whether to stat the main script file and the fullpath includes.\r\napc.stat=1\r\n; Vertification with ctime will avoid problems caused by programs such as svn or rsync by making \r\n; sure inodes have not changed since the last stat. APC will normally only check mtime.\r\napc.stat_ctime=0\r\n; Whether to canonicalize paths in stat=0 mode or fall back to stat behaviour\r\napc.canonicalize=0\r\n; With write_lock enabled, only one process at a time will try to compile an \r\n; uncached script while the other processes will run uncached\r\napc.write_lock=1\r\n; Logs any scripts that were automatically excluded from being cached due to early\/late binding issues.\r\napc.report_autofilter=0\r\n; RFC1867 File Upload Progress hook handler\r\napc.rfc1867=0\r\napc.rfc1867_prefix=upload_\r\napc.rfc1867_name=APC_UPLOAD_PROGRESS\r\napc.rfc1867_freq=0\r\napc.rfc1867_ttl=3600\r\n; Optimize include_once and require_once calls and avoid the expensive system calls used.\r\napc.include_once_override=0\r\napc.lazy_classes=0\r\napc.lazy_functions=0\r\n; Enables APC handling of signals, such as SIGSEGV, that write core files when signaled. \r\n; APC will attempt to unmap the shared memory segment in order to exclude it from the core file\r\napc.coredump_unmap=0\r\n; Records a md5 hash of files. \r\napc.file_md5=0\r\n; not documented\r\napc.preload_path\r\n<\/pre>\n<p>Anschlie\u00dfend sollte der Webserver neugestartet werden, damit die neue Konfiguration wirksam wird.<\/p>\n<pre lang=\"shell\">\/etc\/init.d\/httpd restart graceful<\/pre>\n<p>Um zu \u00fcberpr\u00fcfen, ob PHP die APC Erweiterung erfolgreich geladen hat, kann mit folgendem Befehl die Ausgabe von phpinfo() auf den APC Bereich beschr\u00e4nkt werden:<\/p>\n<pre lang=\"shell\">php -r 'phpinfo();'|grep apc<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>APC ist ein Cache System f\u00fcr PHP (Alternative PHP Cache) und als PECL Modul verf\u00fcgbar. Die Installation auf CentOS wird wie folgt durchgef\u00fchrt: yum install pcre-devel yum install php-pecl-apc.x86_64 php-pecl-apc-devel.x86_64 Anschlie\u00dfend muss noch eine ini-Datei erstellt werden, in der einerseits die PHP-Extension geladen wird und andererseits Konfigurationen f\u00fcr APC vorgenommen werden k\u00f6nnen.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[429,432,430,431,67,121],"_links":{"self":[{"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/posts\/698"}],"collection":[{"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/comments?post=698"}],"version-history":[{"count":3,"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/posts\/698\/revisions"}],"predecessor-version":[{"id":701,"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/posts\/698\/revisions\/701"}],"wp:attachment":[{"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/media?parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/categories?post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xcep.net\/blog\/wp-json\/wp\/v2\/tags?post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}