Share Article To
How to Install VLD on Linux and OS X, php opcode, machine language, print opcode, print php opcode, dump opcode, how to use php vld extension

PHP WorkflowVulcan Logic Dumper mainly known as VLD is a PHP extension by which you can see your PHP code in opcode format. This format will help advanced developers to optimize their PHP code. VLD hooks into the Zend Engine and dumps all the opcodes (execution units) of a script. It can be used to see what is going on in the Zend Engine.

This extension’s all versions are in beta state and probably will never be in stable state(as per vld developers)
Latest Version: 0.12 Compatible Upto: 5.5

 

Download and Installation Instructions

Step: 1
If svn installed in your system then get the code from its repository by executing below command

svn co svn://svn.xdebug.org/svn/php/vld/trunk vld

Else execute below lines of command

wget http://pecl.php.net/get/vld
tar xzf vld-0.11.1.tgz

Now rename the vld-0.11.1 by vld

Step: 2
cd into the vld directory and execute the following command

Step: 3

phpize
./configure
make install

Step: 4
Open php.ini file using below command

vim /etc/php.ini

Now add the below code into this file.

extension=vld.so

Step: 5
Restart your apache/httpd service

service httpd restart

Congratulations you are done with vld installation.

Do confirmation that whether the vld properly installed or not
In terminal execute the below code
Way 1:

php -m | grep vld

If output is `vld` then all is fine.
Way 2:
Do phpinfo() on browser
Now if in listing vld is present then all is fine

Print opcode
Create a php file.
Write some sample code.
Execute the below command in terminal

php -dvld.active=1 yourfilename.php

What is printed on your terminal screen is called php opcode.

If you are using this tool first time start with some simple code like

echo 'hello';
print 'hello';
$name = 'Soumi';
echo 'My name is ' . $name;
echo "My name is $name";
echo 'My name is ', $name;

Leave a Reply

Your email address will not be published. Required fields are marked *