trzxycx 发表于 2017-3-20 10:53:43

PHP安装VLD查看opcode

  # wget http://pecl.php.net/get/vld-0.10.1.tgz
# tar zxvf vld-0.10.1.tgz
# cd ./vld-0.10.1
# /usr/local/php/bin/phpize 或者直接phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --enable-vld
# make && make install
  ---------------------------------
  编辑php.ini文<wbr>件激活vld扩展:<br><br>extension=<wbr>vld.so</wbr></wbr>
  重启Apache:
# /usr/local/apache2/bin/apachectl restart
---------------------------------
  至此,VLD就安装完了。写个简单的test.php
  <?php $a='123'; echo $a;?>
  # php -dvld.active=1 ./test.php
  如果没有设置php环境变量的话

#/usr/local/php/bin/php -dvld.active=1 test.php

会看到

Finding entry points

Branch analysis from position: 0

Return found

filename: /home/kaisha/study/php/test.php

function name: (null)

number of ops: 4

compiled vars: !0 = $a

line # * op fetch ext return operands

---------------------------------------------------------------------------------
2 0 > ASSIGN !0, '123'

3 1 ECHO !0

5 2 > RETURN 1

3* > ZEND_HANDLE_EXCEPTION



branch: # 0; line: 2- 5; sop: 0; eop: 3

path #1: 0,
  ========================
  延伸阅读参考:
  http://www.phppan.com/2011/05/vld-extension/
  http://blog.csdn.net/phpkernel/article/details/5718519
  http://www.laruence.com/2008/06/18/221.html
  http://blog.zol.com.cn/1023/article_1022664.html
页: [1]
查看完整版本: PHP安装VLD查看opcode