简介:这是PHP运行机制分析(多图)的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=330429' scrolling='no'>
Introduction
Apache
Mime type handler
? AddType application/x-httpd-php .php
? AddType application/x-httpd-php-source .phps
Server context
? Override php.ini (php_value, php_flag, etc)
? Environment variables(PHP_SELF, etc)
? Create Child Process/Thread
CLI (command line interface)
CLI ≈ CGI SAPI
differences
? start up in quiet mode by default
? plain text error message(no http header)
? implicit_flush always on
? max_execution_time is set to unlimited
? others
Embed
Embed = Mini CLI
php5embed .lib
example.c
C++代码
- #include <php_embed.h>
- int main (int argc, char *argv[]){
- PHP_EMBED_START_BLOCK(argc, argv)
- zend_eval_string(“echo ?Hello World?;”, NULL, “Embedded Code” TSRMLS_CC);
- PHP_EMBED_END_BLOCK()
- return 0;
- }
Lexer(flex)
Compiler
Opcode
C++代码
- struct zend_op {
- opcode_handler_t handler;
- znode result;
- znode op1;
- znode op2;
- ulong extended_value;
- uint lineno;
- zend_uchar opcode;
- };
本文来源: Ben ben.yan@msn.com