# PHP CLI and opcode caches

- Thread: https://externals.io/message/44939
- Original archive: https://news-web.php.net/php.internals/44939
- Started by Thomas Koch on 2009-07-13T06:37:52+00:00
- Messages: 4
- 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

---

## #44939 — Thomas Koch — 2009-07-13T06:37:52+00:00

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

Hi,

I have some PHP scripts to be run as daemons or as gearman workers. Now it 
would be fine, if PHP could make use of an opcode cache also for CLI scripts.

Is anybody aware of an opcode cache (APC, XCache, eaccelerator) that could be 
addapted in this way? Two possible scenarios:

- A Runner starts and keeps running x PHP threads with the same PHP script 
which share an opcode cache.
- A gearman worker starts different PHP scripts according to the requested 
task. All threads share the opcode cache.

Which is the best mailing list to discuss this further, please?

Best regards,

Thomas Koch, http://www.koch.ro

---

## #44953 — Peter Wang — 2009-07-13T09:34:33+00:00

URL: https://externals.io/message/44939#44953 · In reply to: #44939

Thomas Koch <thomas@koch.ro> writes:

http://www.php.net/manual/en/apc.configuration.php#ini.apc.enable-cli

is that what you want?

> Hi,
>
> I have some PHP scripts to be run as daemons or as gearman workers. Now it 
> would be fine, if PHP could make use of an opcode cache also for CLI scripts.
>
> Is anybody aware of an opcode cache (APC, XCache, eaccelerator) that could be 
> addapted in this way? Two possible scenarios:
>
> - A Runner starts and keeps running x PHP threads with the same PHP script 
> which share an opcode cache.
> - A gearman worker starts different PHP scripts according to the requested 
> task. All threads share the opcode cache.
>
> Which is the best mailing list to discuss this further, please?
>
> Best regards,
>
> Thomas Koch, http://www.koch.ro

---

## #44954 — Edward Z. Yang — 2009-07-14T14:33:50+00:00

URL: https://externals.io/message/44939#44954 · In reply to: #44953

Excerpts from Peter Wang's message of Mon Jul 13 05:34:33 -0400 2009:
> http://www.php.net/manual/en/apc.configuration.php#ini.apc.enable-cli
> 
> is that what you want?

Not really, since the manual even specifically states that the opcode cache
will get created and destroyed.  I think Thomas is looking for something
a little similar to Python's pyc files.

---

## #44955 — Eddie Drapkin — 2009-07-14T14:36:00+00:00

URL: https://externals.io/message/44939#44955 · In reply to: #44954

> Excerpts from Peter Wang's message of Mon Jul 13 05:34:33 -0400 2009:
> > […]
>
> Not really, since the manual even specifically states that the opcode cache
> will get created and destroyed.  I think Thomas is looking for something
> a little similar to Python's pyc files.
>
> --
> 
> 
>
>

I've seen Roadsend: http://www.roadsend.com/home/index.php?pageID=compiler
and PhC: www.phpcompiler.org

I think these are closer to what you want, but I'm not sure either are
worth using, as I've used neither.  If you do use one, or both, let me
know for sure :)
