apc

Call to undefined method after upgrading to PHP 5.4.0

前提是你 提交于 2019-12-12 15:24:35
问题 Stumped by this one. This code is giving me PHP Fatal error: Call to undefined method MyObject::helloWorld() But only the second time I run it, the first time it runs fine. class MyObject { function __construct() { echo("creating MyObject..."); } public function helloWorld() { echo("Hello World!"); } } $obj = new MyObject(); $obj->helloWorld(); I also see "creating MyObject..." generated the second time, but not "Hello World!". I'm in the process of upgrading to PHP 5.4.0. I Must be missing

Full page cache with APC possible? (CakePHP)

老子叫甜甜 提交于 2019-12-11 10:33:47
问题 I have my website cached using full page caching. So for every page an html file is created. As I am using CakePHP, I can define that APC caching would be used instead of file caching. However, if done that, html files are still being created (APC is installed correctly). So question: is there any logic in using APC with full page caching? Does it give any benefits? Is it possible to put cached html file to RAM somehow and read it from there when needed? P.S. I am not talking about APC opcode

PHP APC Progress Bar

一笑奈何 提交于 2019-12-11 07:28:33
问题 Post Updated: After commentors advice. Index.php <?php $id = uniqid(""); ?> </head> <body> <form method="post" action="frame.php" target="upload_iframe" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="<?php echo $id; ?>"/> <br /> <input type="submit" name="submit" value="Submit" /> </form> <iframe name="upload_iframe" style="width: 400px; height: 100px;"> <

APC - Unable to load dynamic library

旧时模样 提交于 2019-12-11 02:54:47
问题 Here is what I have in my PHP.ini: extension=php_apc.dll ... [APC] apc.enabled = 1 I'm running Apache 2.0.59, PHP version 5.2.3 on Windows Server 2003. I've already installed XDebug compiled with vc6. Thus, I got the APC version 5.2 vc6. Here are both filenames that I downloaded (and put the *.dll in php/ext/). php_apc-3.1.5-5.2-vc6-x86.zip php_apc-3.1.5-5.2-nts-vc6-x86.zip I got them here. I've tried rebooting the server and in both cases, I get the following error: PHP Warning: PHP Startup:

PHP Stats Object Stored in Memory Concurrent Updates = Data Loss?

我的未来我决定 提交于 2019-12-11 02:44:58
问题 I want to abstract stats counting on objects within my system to a single place. At the moment each object increments a counter on its row in the MySQL table i.e. UPDATE sometable SET views = views + 1 WHERE id = ? In order to get a significant performance gain instead of writing this update to the DB every time the object is used, I'd like to use apc to store a singleton analytics object in memory increment counters within this object and periodically save this object back to the DB. However

APC (PHP Cache) Uptime 0 minutes, not caching

断了今生、忘了曾经 提交于 2019-12-10 16:14:37
问题 My goal is to implement APC for opcode cache for a drupal 6 production site. I have so far tested APC with several php files with and without including other php files with include_once. Also tried to tweak the apc.ini values for shm_size, apc.include_once_override and apc.stat. Restarted apache every time. Resulting in apc.php not showing any changes in any values. (except of course the changed apc.ini values are shown as they should) Every time i refresh the apc.php test page, the start

APC not speeding up PHP 5.4

妖精的绣舞 提交于 2019-12-10 04:34:01
问题 I have had this problem before on WAMP Server and PHP 5.3, and now facing it on Linux with PHP 5.4. Basically, APC enabled or disabled makes no difference in performance, despite what the stats in apc.php say. Here is a sample test script, which includes more than 30 Doctrine PHP files, and times it: $t = microtime(true); include 'Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'; printf('%.3f s', microtime(true)-$t); Result on Windows ( Zend Server CE, PHP 5.4 ) : 0.001 s Result on Linux

sudo pecl install apc error on os x lion

元气小坏坏 提交于 2019-12-10 01:14:03
问题 I tried installing APC with pecl on OS X Lion ( sudo pecl install apc ) and it complained about a missing pcre.h file: In file included from /private/tmp/pear/temp/APC/apc.c:44: /usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found #include "pcre.h" So I used MacPorts to install the pcre package ( sudo port install pcre ) but it still complains. How can I fix this? 回答1: I think this is because MacPorts installs the header files in a different location from where

PHP and the million array baby

旧巷老猫 提交于 2019-12-09 15:05:02
问题 Imagine you have the following array of integers: array(1, 2, 1, 0, 0, 1, 2, 4, 3, 2, [...] ); The integers go on up to one million entries; only instead of being hardcoded they've been pre-generated and stored in a JSON formatted file (of approximately 2MB in size). The order of these integers matters, I can't randomly generate it every time because it should be consistent and always have the same values at the same indexes. If this file is read back in PHP afterwards (e.g. using file_get

Basics of PHP opcode cache

无人久伴 提交于 2019-12-09 13:49:04
问题 Currently on a very large project that I do not plan to re-use for another site, I have the site's name hardcoded into the files everywhere. Now, if I were ever to change the site name it would take a lot of effort to change that everywhere. I know the obvious solution is to just store the name as a variable or a constant, but I guess you could call it my micro-optimizing way of thinking: I always figured it would be one less thing PHP has to parse. I do realize it won't make much difference,