PHP7原始碼分析之CG和EG

2021-10-06 09:21:48 字數 766 閱讀 2153

cg的含義是 compiler_globals。zend編譯器相關的全域性變數。

大家都知道php**最終是轉化為opcode去執行的。在php轉換為opcode過程中需要儲存一些資訊。這些資訊就儲存在cg全域性變數中。

/* compiler */

#ifdef zts

#else

extern zend_api struct _zend_compiler_globals compiler_globals;

#endif

eg的含義是 executor_globals。zend執行器相關的全域性變數。

zend引擎在執行opcode的時候,需要記錄一些執行過程中的狀態。如,當前執行的類作用域,當前已經載入了那些檔案,等。

/* executor */

#ifdef zts

#else

extern zend_api zend_executor_globals executor_globals;

#endif

eg和cg有一些資料是共用的。如,function_table (儲存方法資訊) , class_table (儲存類資訊) 。

void init_executor(void) /* {{{ */

zend_init_fpu();

eg(function_table) = cg(function_table);

eg(class_table) = cg(class_table);

國內php7安裝源 原始碼安裝PHP7

2.解壓 tar xzf php 7.2.4.tar.bz2 3.安裝 cd php 7.2.4 configure prefix data server php7 配置安裝路徑 make 編譯 make install 安裝 4.配置全域性環境 如果執行php v命令無效則進行這項配置 開啟配置檔...

原始碼安裝PHP7和ApachePHP支援

本文參考文章,並在安裝過程中出現的問題加入解決方法。系統centos6.5 首先公升級yum倉 yum install epel release 擴充套件包更新包 yum update 更新yum源 安裝php依賴環境 yum y install libxml2 libxml2 devel open...

centos6 5 原始碼安裝php7

編譯安裝即可 tar zxvf libmcrypt 2.5.8.tar.gz cd libmcrypt 2.5.8 configure make make install 編輯 vim etc ld.so.conf 末行新增 usr local lib 並執行 ldconfig 編譯安裝過程 php...