1

I'm wondering how the php scripts are executed. I know that they are compiled into bytecode, and the bytecode is executed, but I don't know how that bytecode is executed, what executes that bytecode, etc... Can anybody answer that?

inf3rno
  • 24,976
  • 11
  • 115
  • 197
  • When I open the task manager on Windows (XAMPP), I don't see one process for each PHP script ;) – ComFreek Nov 14 '11 at 17:27
  • 2
    PHP itself is executing the compiled script. That's why from the command line you execute PHP and give the script as a parm. The web server essentially does the same, executing PHP and giving it the script name. – Jonathan M Nov 14 '11 at 17:27
  • Depends on the SAPI. With Apache+mod_php it's typically one process per script/interpreter. As is it with FastCGI. Other setups (IIS) might use threads. What's the practical relevance for this question? – mario Nov 14 '11 at 17:29
  • I would give you the points mario if I could :-) Please create an answer from your comment! :-) – inf3rno Nov 17 '11 at 20:23

2 Answers2

0

"Depends on the SAPI. With Apache+mod_php it's typically one process per script/interpreter. As is it with FastCGI. Other setups (IIS) might use threads." - mario

inf3rno
  • 24,976
  • 11
  • 115
  • 197
0

I'm not sure what you want, but if I understand you need to know how php executes a script I think there is already an answer.

Community
  • 1
  • 1
Galled
  • 4,146
  • 2
  • 28
  • 41