# APC doesn't work on Windows?

- Thread: https://externals.io/message/37839
- Original archive: https://news-web.php.net/php.internals/37839
- Started by Edward Z. Yang on 2008-05-23T19:22:56+00:00
- Messages: 17
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #37839 — Edward Z. Yang — 2008-05-23T19:22:56+00:00

URL: https://externals.io/message/37839#37839

I don't really care either way, but if it's a well known fact, might as
well stop trying. Does APC work on Windows? I recently submitted a patch
 to fix the snaps.php.net compilation of APC, but for any non-trivial
script (interestingly enough, apc.php and and `phpinfo()` work fine), APC
segfaults or otherwise fatally errors. Some errors I've seen include:

[apc-error] Cannot redeclare class simpletest, referer: http://localhost/

on code that works perfectly without APC. I've scanned the bug list and
there are quite a few reports of APC not working on Windows--so, is this
generally known to be the case?
-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #37842 — Jared Williams — 2008-05-23T23:32:32+00:00

URL: https://externals.io/message/37839#37842 · In reply to: #37839

> -----Original Message-----
> From: Edward Z. Yang [mailto:edwardzyang@thewritingpot.com] 
> Sent: 23 May 2008 20:23
> To: internals@lists.php.net
> Subject: [PHP-DEV] APC doesn't work on Windows?
> 
> I don't really care either way, but if it's a well known 
> fact, might as well stop trying. Does APC work on Windows? I 
> recently submitted a patch  to fix the snaps.php.net 
> compilation of APC, but for any non-trivial script 
> (interestingly enough, apc.php and and `phpinfo()` work fine), 
> APC segfaults or otherwise fatally errors. Some errors I've 
> seen include:
> 
> [apc-error] Cannot redeclare class simpletest, referer: 
> http://localhost/
> 
> on code that works perfectly without APC. I've scanned the 
> bug list and there are quite a few reports of APC not working 
> on Windows--so, is this generally known to be the case?
> -- 

I'm running php 5.2.5 NTS with APC 3.1.0-dev. It works, but not without some
issues, like occasionally get a FastCGI process crashing which I suspect is
APC.

More worringly, have a tiny application which consistantly executes the
wrong page, when APC is enabled. 

The index.php opens a frameset, with the left frame requesting browser.php,
but instead the output of index.php is sent. 
Disable APC and the problem goes away.

Haven't been enable to write a failing test case to report it. 

Jared

---

## #37845 — Edward Z. Yang — 2008-05-24T02:03:57+00:00

URL: https://externals.io/message/37839#37845 · In reply to: #37842

Jared Williams wrote:
> I'm running php 5.2.5 NTS with APC 3.1.0-dev. It works, but not without some
> issues, like occasionally get a FastCGI process crashing which I suspect is
> APC.

Hello Jared,

Doesn't running APC under FastCGI kind of defeat the purpose of APC?

-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #37846 — Rasmus Lerdorf — 2008-05-24T02:17:15+00:00

URL: https://externals.io/message/37839#37846 · In reply to: #37839

Edward Z. Yang wrote:
> I don't really care either way, but if it's a well known fact, might as
> well stop trying. Does APC work on Windows? I recently submitted a patch
>  to fix the snaps.php.net compilation of APC, but for any non-trivial
> script (interestingly enough, apc.php and and `phpinfo()` work fine), APC
> segfaults or otherwise fatally errors. Some errors I've seen include:
> 
> [apc-error] Cannot redeclare class simpletest, referer: http://localhost/
> 
> on code that works perfectly without APC. I've scanned the bug list and
> there are quite a few reports of APC not working on Windows--so, is this
> generally known to be the case?

We don't have any active developers contributing to APC on Windows at 
the moment.  We try to not do stuff that will break Windows, but beyond 
that we rely on people interested in that platform to step up and help out.

-Rasmus

---

## #37848 — Christian Hoffmann — 2008-05-24T09:52:32+00:00

URL: https://externals.io/message/37839#37848 · In reply to: #37845

> Jared Williams wrote:
> > […]
> 
> Hello Jared,
> 
> Doesn't running APC under FastCGI kind of defeat the purpose of APC?
No, why should it? The cache is shared perfectly fine if you let PHP 
handle the process spawning (i.e. increasing PHP_FCGI_CHILDREN instead 
of running php-cgi -b (or whatever) multiple times).

I used APC w/ FastCGI some time ago and I'm still using another opcode 
cache with FastCGI at the moment (XCache), and I know lots of people 
doing the same. :)


-- 
Christian Hoffmann

---

## #37849 — Arvids Godjuks — 2008-05-24T09:53:02+00:00

URL: https://externals.io/message/37839#37849 · In reply to: #37839

Use XCache instead - it's simple, fast and stable. APC is far more complex
and unstable (is't like code for code)

2008/5/23 Edward Z. Yang <edwardzyang@thewritingpot.com>:

> I don't really care either way, but if it's a well known fact, might as
> well stop trying. Does APC work on Windows? I recently submitted a patch
>  to fix the snaps.php.net compilation of APC, but for any non-trivial
> script (interestingly enough, apc.php and and `phpinfo()` work fine), APC
> segfaults or otherwise fatally errors. Some errors I've seen include:
>
> [apc-error] Cannot redeclare class simpletest, referer: http://localhost/
>
> on code that works perfectly without APC. I've scanned the bug list and
> there are quite a few reports of APC not working on Windows--so, is this
> generally known to be the case?
> --
>  Edward Z. Yang                        GnuPG: 0x869C48DA
>  HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
>  [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #37877 — phpxcache — 2008-05-26T01:34:31+00:00

URL: https://externals.io/message/37839#37877 · In reply to: #37848

you're right, but too bad there's no PHP_FCGI_CHILDREN (pre-fork) for
windows, not even any alternatives
{{{
#ifndef PHP_WIN32
    /* Pre-fork, if required */
    if (getenv("PHP_FCGI_CHILDREN")) {
        children = atoi(getenv("PHP_FCGI_CHILDREN"));
}}}

> No, why should it? The cache is shared perfectly fine if you let PHP handle
> the process spawning (i.e. increasing PHP_FCGI_CHILDREN instead of running
> php-cgi -b (or whatever) multiple times).
>
> I used APC w/ FastCGI some time ago and I'm still using another opcode cache
> with FastCGI at the moment (XCache), and I know lots of people doing the
> same. :)
>
>
> --
> Christian Hoffmann

---

## #37878 — Edward Z. Yang — 2008-05-26T04:11:17+00:00

URL: https://externals.io/message/37839#37878 · In reply to: #37848

Christian Hoffmann wrote:
> No, why should it? The cache is shared perfectly fine if you let PHP
> handle the process spawning (i.e. increasing PHP_FCGI_CHILDREN instead
> of running php-cgi -b (or whatever) multiple times).

As phpxcache mentioned, that's not an option in Windows. Are you running
Windows or Linux? I'm sure APC works on Linux; I'm curious about Windows.

-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #37879 — Edward Z. Yang — 2008-05-26T04:13:47+00:00

URL: https://externals.io/message/37839#37879 · In reply to: #37846

Rasmus Lerdorf wrote:
> We don't have any active developers contributing to APC on Windows at
> the moment.  We try to not do stuff that will break Windows, but beyond
> that we rely on people interested in that platform to step up and help out.

I wish I could say, "Yes! I'm interested in helping out!" but I don't
know enough about this area to really do anything useful except complain
that things aren't working. When I get a chance, I'm going to try to set
up APC on a clean Windows Vista install with the pre-compiled binaries.
If it still fails, I give up and figure out how to install APC on Ubuntu.

-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #37880 — Edward Z. Yang — 2008-05-26T04:15:27+00:00

URL: https://externals.io/message/37839#37880 · In reply to: #37849

Arvids Godjuks wrote:
> Use XCache instead - it's simple, fast and stable. APC is far more complex
> and unstable (is't like code for code)

I wouldn't dare host a production website on a Windows website ;-). I'm
much more interested in getting APC running for testing purposes; seeing
how nicely my code plays with the opcode cache, whether or not a
different include scheme would result in better performance, etc.
Testing with XCache would be helpful (and I will certainly look into
it), but APC is the industry standard and my first priority.

-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #37881 — Christian Hoffmann — 2008-05-26T07:18:49+00:00

URL: https://externals.io/message/37839#37881 · In reply to: #37878

> Christian Hoffmann wrote:
> > […]
> 
> As phpxcache mentioned, that's not an option in Windows. Are you running
> Windows or Linux? I'm sure APC works on Linux; I'm curious about Windows.
> 
Sorry, I'm running Linux and did not think of a reason why 
PHP_FCGI_CHILDREN would not be supported on windows, especially since 
the "normal" way of doing FastCGI doesn't work on Windows at all (as fd 
!= socket in Windows).
So, mOo is right of course. :)

-- 
Christian Hoffmann

---

## #37882 — Arvids Godjuks — 2008-05-26T08:37:34+00:00

URL: https://externals.io/message/37839#37882 · In reply to: #37880

I run Linux :)
There is no difference whatever it's APC or XCache - they do the same and
their speed's are identical, XCache is little faster but thouse are below
0.5-1 % differences. So i purpose you try XCache on Windows and see if it's
working fine. At least I haven't seen any complaints on XCache forum that it
doesn't work under Windows. And Xcache has admin page with all stats you
need to see what is happening inside it. It's site is
http://xcache.lighttpd.net/


2008/5/26 Edward Z. Yang <edwardzyang@thewritingpot.com>:

> Arvids Godjuks wrote:
> > […]
> complex
> > […]
>
> I wouldn't dare host a production website on a Windows website ;-). I'm
> much more interested in getting APC running for testing purposes; seeing
> how nicely my code plays with the opcode cache, whether or not a
> different include scheme would result in better performance, etc.
> Testing with XCache would be helpful (and I will certainly look into
> it), but APC is the industry standard and my first priority.
>
> --
>  Edward Z. Yang                        GnuPG: 0x869C48DA
>  HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
>  [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #37883 — Tomas Kuliavas — 2008-05-26T09:21:43+00:00

URL: https://externals.io/message/37839#37883 · In reply to: #37882

> I run Linux :)
> There is no difference whatever it's APC or XCache - they do the same and
> their speed's are identical, XCache is little faster but thouse are below
> 0.5-1 % differences.

xcache does not reduce peak memory usage. APC and Zend Accelerator do.

-- 
Tomas

---

## #37887 — Derick Rethans — 2008-05-26T10:03:58+00:00

URL: https://externals.io/message/37839#37887 · In reply to: #37849

> Use XCache instead - it's simple, fast and stable. APC is far more complex
> and unstable (is't like code for code)

I've never found APC to be unstable. And I imagine that neither Yahoo or 
facebook have issues with this. You might just be seeing a bug in an 
extension that just gets more prone to show up when APC is activated.

On top of that, as we've no idea who actually develops Xcache -- I just 
see "phpxcache" -- I wouldn't want to put this on any sort of production 
machine either. I simply can't trust an alias of one person over a group 
of people that have shown to know a helluvalot about PHP's internals.

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

---

## #37888 — Scott McNaught [Synergy 8] — 2008-05-26T10:13:04+00:00

URL: https://externals.io/message/37839#37888 · In reply to: #37887

I have run APC on my windows PC for years (development machine), through many different php versions. I have found APC to be unstable when loaded with debugging libraries (espec zend debugger). Other than that, it is stable as.

If you are having troubles, maybe check to see if you have any debugging dlls loaded.

-----Original Message-----
From: Derick Rethans [mailto:derick@php.net] 
Sent: Monday, May 26, 2008 8:04 PM
To: Arvids Godjuks
Cc: Edward Z. Yang; internals@lists.php.net
Subject: Re: [PHP-DEV] APC doesn't work on Windows?



> Use XCache instead - it's simple, fast and stable. APC is far more complex
> and unstable (is't like code for code)

I've never found APC to be unstable. And I imagine that neither Yahoo or 
facebook have issues with this. You might just be seeing a bug in an 
extension that just gets more prone to show up when APC is activated.

On top of that, as we've no idea who actually develops Xcache -- I just 
see "phpxcache" -- I wouldn't want to put this on any sort of production 
machine either. I simply can't trust an alias of one person over a group 
of people that have shown to know a helluvalot about PHP's internals.

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

---

## #37889 — Pierre Joye — 2008-05-26T10:20:00+00:00

URL: https://externals.io/message/37839#37889 · In reply to: #37887

> 
>
> > […]
>
> I've never found APC to be unstable. And I imagine that neither Yahoo or
> facebook have issues with this. You might just be seeing a bug in an
> extension that just gets more prone to show up when APC is activated.
>
> On top of that, as we've no idea who actually develops Xcache -- I just
> see "phpxcache" -- I wouldn't want to put this on any sort of production
> machine either. I simply can't trust an alias of one person over a group
> of people that have shown to know a helluvalot about PHP's internals.

The main problem here is to propose to use xyz when one is asking
support for APC. It is like saying to use Python/Ruby/Java to anyone
posting a bug or a question here, pointless.

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

---

## #37893 — Arvids Godjuks — 2008-05-26T12:06:08+00:00

URL: https://externals.io/message/37839#37893 · In reply to: #37887

Xcache is developed by mOo - one of the Lighttpd developers, so he can be
found on Lighttpd forum (they have XCache section), mailing list and IRC. I
have no trouble reaching lighttpd and xcache developers on IRC and they
helped me a lot, bugs I found were confirmed, fixed and deployed to SVN less
than in a hour - you just never used it and you don't know this software.
That doesn't mean it's bad or unstable. People are confirming it's stability
all the time.

Some my colleagues had bad luck with APC, so I just use what works for me
fine.

2008/5/26 Derick Rethans <derick@php.net>:

> 
>
> > […]
> complex
> > […]
>
> I've never found APC to be unstable. And I imagine that neither Yahoo or
> facebook have issues with this. You might just be seeing a bug in an
> extension that just gets more prone to show up when APC is activated.
>
> On top of that, as we've no idea who actually develops Xcache -- I just
> see "phpxcache" -- I wouldn't want to put this on any sort of production
> machine either. I simply can't trust an alias of one person over a group
> of people that have shown to know a helluvalot about PHP's internals.
>
> regards,
> Derick
>
> --
> Derick Rethans
> http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
