利用PHP扩张vld查看PHP opcode
利用PHP扩展vld查看PHP opcode
作者:zhanhailiang 日期:2013-03-04
首先下载最新版vld扩展:
~/public_html/php-5.3.13/ext> wget http://pecl.php.net/get/vld-0.11.2.tgz~/public_html/php-5.3.13/ext> tar zxvf vld-0.11.2.tgz ~/public_html/php-5.3.13/ext> cd vld-0.11.2/
接下来编译安装vld扩展:
~/public_html/php-5.3.13/ext/vld-0.11.2> phpize ~/public_html/php-5.3.13/ext/vld-0.11.2> ./configure --with-php-config=/usr/local/services/php/bin/php-config --enable-vld~/public_html/php-5.3.13/ext/vld-0.11.2> make~/public_html/php-5.3.13/ext/vld-0.11.2> sudo make installInstalling shared extensions: /usr/local/services/php/lib/php/extensions/no-debug-non-zts-20090626/
最后将生成的vld.so复制到extension_dir目录下:
~/public_html/php-5.3.13/ext/vld-0.11.2> cd /usr/local/services/php/lib/php/extensions/no-debug-non-zts-20090626//usr/local/services/php/lib/php/extensions/no-debug-non-zts-20090626> sudo cp vld.so /usr/local/services/php/extensions/
然后修改php.ini文件,添加如下配置:
<span class="re1" style="color:rgb(0,0,255)">extension</span><span class="sy0" style="color:rgb(102,204,102)">=</span><span class="re2" style="color:rgb(0,0,255)">vld.so</span>
接下来创建test.php文件:
<span class="kw2" style="color:rgb(0,0,0); font-weight:bold"><?php</span> <span class="re0" style="color:rgb(0,0,255)">$a</span> <span class="sy0" style="color:rgb(102,204,102)">=</span> <span class="st0" style="color:rgb(255,0,0)">"hello world"</span><span class="sy0" style="color:rgb(102,204,102)">;</span> <span class="kw1" style="color:rgb(177,177,0)">echo</span> <span class="re0" style="color:rgb(0,0,255)">$a</span> <span class="sy0" style="color:rgb(102,204,102)">.</span> PHP_EOL<span class="sy0" style="color:rgb(102,204,102)">;</span>
使用cli来执行,查看生成的opcode:
~/public_html> php -dvld.active=1 test.php Finding entry pointsBranch analysis from position: 0Return foundfilename: /home/zhanhailiang/public_html/test.phpfunction name: (null)number of ops: 4compiled vars: !0 = $aline # * op fetch ext return operands--------------------------------------------- 3 0 > ASSIGN !0, 'hello+world' 5 1 CONCAT ~1 !0, '%0A' 2 ECHO ~1 6 3 > RETURN 1 branch: # 0; line: 3- 6; sop: 0; eop: 3path #1: 0, hello world

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

To work on file upload we are going to use the form helper. Here, is an example for file upload.

Validator can be created by adding the following two lines in the controller.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an
