|
Posted by |-|erc on 11/03/05 10:47
"MBS" <mbs@mbs.net> wrote in ...
: As far as I know PHP code is always a script which is interpreted by the
: PHP interpreter, compiled to machine code, then executed by the CPU. Much
: like Java, one could say. (I am not talking about the source code to PHP
: itself; rather, the code that one using the PHP language would write.)
:
: However, since the interpreter has to compile the PHP source prior to
: execution, it is being compiled anyway, so why not just compile it from the
: beginning and save the overhead required by the interpreter, thus allowing
: the code to run faster?
:
: I'm new to PHP. So I was just wondering. I'm using PHP with Apache. From
: what I understand compiled executables can be used with Apache via CGI or
: something. Not quite sure how that works.
:
: If anyone wishes to clue me in I'd appreciate it. Thanks.
Interpreters don't compile! The php code is simulated by Apache, there is no associated file.exe
that control of the CPU is passed to.
A script will run faster with successive runs as the optimizer builds up information about the script,
similar to compiling.
Interpreted code has a few advantages, simpler, no hangs, dynamic content, but in future it could
all be compiled. For 99% of sites you won't notice any difference.
Herc
[Back to original message]
|