apc

Choosing a PHP caching technique: output caching into files vs. opcode caching

空扰寡人 提交于 2019-11-30 04:06:08
问题 I've heard of two caching techniques for the PHP code: When a PHP script generates output it stores it into local files. When the script is called again it check whether the file with previous output exists and if true returns the content of this file. It's mostly done with playing around the "output buffer". Somthing like this is described in this article. Using a kind of opcode caching plugin, where the compiled PHP code is stored in memory. The most popular of this one is APC, also

Symfony2 + Doctrine2 is not caching results of joined entities

ⅰ亾dé卋堺 提交于 2019-11-30 03:19:28
I am using Symfony 2.0.10 with Doctrine 2.1 and have rather simple query (see below), where I want to cache results with APC (version 3.1.7, enabled 1GB of memory for it) via useResultCache(true, 600) and keep hydration mode as \Doctrine\ORM\Query::HYDRATE_OBJECT . The problem is that Many-to-Many relations ( Doctrine\ORM\PersistentCollection ) don't get cached and every time when main query results are cached the joined entities are set to null . The same query is cached well in APC when I set hydration mode to \Doctrine\ORM\Query::HYDRATE_ARRAY , but it is not acceptable solution for me,

How to make APC (PHP Cache) work?

一世执手 提交于 2019-11-30 02:06:24
I've read about APC that it speeds up multiple php file sites. So I have this particular project in PHP with many files and i discover that require_once and parsing only class definitions (without executing them) takes most time. So I've installed APC on my CentOS 5 server. I moved apc.php to my webserver and it displays Hits: 1 (50.0%) Misses: 1 (50.0%) Cached Files 1 (281.1 KBytes) And I can go to website and change subpages and so on, and apc.php still shows only one cached file ?? And in phpinfo() it shows that: APC Support enabled I don't know what to do. Is APC working (like phpinfo()

Does a graceful Apache restart clear APC?

混江龙づ霸主 提交于 2019-11-30 02:05:06
问题 Will calling $ httpd graceful clear out the APC cache, or do I have to do a full-blown $ httpd restart to do it? (Keeping in mind that I know there are better ways to do it, like calling apc_clear_cache() programmatically). 回答1: Both will clear APC cache. You can also clear cache using the APC.php script. 回答2: Graceful does not wait for active connections to die before doing a "full restart". It is the same as doing a HUP against the master process. Apache keeps children (processes) with

PHP with APC: Fatal errors: Cannot redeclare class

陌路散爱 提交于 2019-11-29 23:34:51
Since I installed APC for PHP with PECL I get sometimes these errors: Cannot redeclare class xxx xxx changes from time to time. I could disable APC but APC improves the performance great! Is there a known bug or could I do something else to prevent these errors? I'm using Ubuntu 8.04 LTS with PHP 5.2.4. Edit/Update (from comments): I use the Zend Framework Autoloader and these error never occurred before I enabled APC. A few moments ago I get for example that error: Fatal error: require(): Cannot redeclare class zend_db_adapter_abstract in /paths/app/lib/Zend/Db/Select.php on line 27 The

Why would apc_store() return false?

限于喜欢 提交于 2019-11-29 16:56:58
问题 The documentation on php.net is very spotty about causes of failure for APC writes. What kind of scenarios would cause a call to apc_store() to fail? There's plenty of disk space available, and the failures are spotty. Sometimes the store operation will succeed and sometimes it'll fail. 回答1: out of memory (allocated memory for apc, that is) 回答2: For php cli it needs to be enabled with another option: apc.enable_cli=On In my situation it was working when running from a webbrowser, but not when

Opcode (APC/XCache), Zend, Doctrine, and Autoloaders

删除回忆录丶 提交于 2019-11-29 02:20:34
I am trying to use either APC or XCache as an opcode to cache my php pages. I am using it with Zend and Doctrine and it's having a problem with the autoloader. If I try with APC, I get the following: Fatal error: spl_autoload() [<a href='function.spl-autoload'>function.spl-autoload</a>]: Class Doctrine_Event could not be loaded in C:\\[mydir]\\library\\doctrine\\Doctrine\\Record.php on line 777 If I try with XCache I get the following: PHP Fatal error: Cannot redeclare class Zend_Registry in C:\\[mydir]\\library\\zendframework\\Zend\\Registry.php on line 0 I'm running Zend 1.9.1, Doctrine 1.1

Symfony2 + Doctrine2 is not caching results of joined entities

本秂侑毒 提交于 2019-11-29 00:57:03
问题 I am using Symfony 2.0.10 with Doctrine 2.1 and have rather simple query (see below), where I want to cache results with APC (version 3.1.7, enabled 1GB of memory for it) via useResultCache(true, 600) and keep hydration mode as \Doctrine\ORM\Query::HYDRATE_OBJECT . The problem is that Many-to-Many relations ( Doctrine\ORM\PersistentCollection ) don't get cached and every time when main query results are cached the joined entities are set to null . The same query is cached well in APC when I

sudo pecl install apc returns error

扶醉桌前 提交于 2019-11-28 21:01:06
I run the command: sudo pecl install apc The file gets downloaded, the configuration succeeds, then make is launched and I get the following error. /usr/include/php5/ext/pcre/php_pcre.h:29: fatal error: pcre.h: No such file or directory Is there a way to fix it? Chris Henry PCRE is a dependency for installing APC. You can install it pretty quick with yum install pcre-devel or apt-get install libpcre3-dev once it's installed, re-run sudo pecl install apc sudo apt-get install libpcre3-dev is the answer. So to be able to install pecl [install extension] the following packages are required: sudo

How to share APC cache between several PHP processes when running under FastCGI?

点点圈 提交于 2019-11-28 16:53:47
I'm currently running several copies of PHP/FastCGI, with APC enabled (under Apache+mod_fastcgi, if that matters). Can I share cache between the processes? How can I check if it's shared already? (I think the apc.mmap_file_mask ini setting might be involved, but I don't know how to use it.) (One of the reasons I think its not shared at the moment is that the apc.mmap_file_mask , as reported by the apc.php web interface flips between about 3 different values as I reload.) APC does not currently share its cache between multiple php-cgi workers running under fastcgi or fcgid. See this feature