First download the latest version of VLD extensions:
Copy Code code as follows:
~/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/
Next compile the installation VLD extension:
Copy Code code as follows:
~/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 install
Installing Shared extensions:/usr/local/services/php/lib/php/extensions/no-debug-non-zts-20090626/
Finally, copy the generated vld.so to the Extension_dir directory:
Copy Code code as follows:
~/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/
Then modify the php.ini file and add the following configuration:
Copy Code code as follows:
Next, create the test.php file:
Copy Code code as follows:
<?php
$a = "Hello World";
echo $a. Php_eol;
Using the CLI to perform, view the generated opcode:
Copy Code code as follows:
~/public_html> php-dvld.active=1 test.php
Finding entry points
Branch analysis from position:0
return found
FileName:/home/zhanhailiang/public_html/test.php
Function name: (NULL)
Number of Ops:4
Compiled VARs:!0 = $a
Line # * OP fetch ext. operands
---------------------------------------------------------------------------------
3 0 > ASSIGN! 0, ' Hello+world '
5 1 CONCAT ~ 0, '%0a '
2 ECHO ~
6 3 > Return 1
Branch: # 0; line:3-6; sop:0; Eop:3
Path #1:0,
Hello World