Looking at what's going on inside PHP recently, I want to know how php generates opcode from a. php file through lexical/grammatical/semantic analysis.
Brother Bird in the blog Amway vld.so this php opcode dump tool, the Internet did not install under OS X mamp installation opcode tutorial, they tinker a bit, record the convenience descendants.
Prerequisites need to install Xcode command line tool This online tutorial more, go to search yourself.
First, create a new directory include in/applications/mamp/bin/php.
Download a corresponding version of the PHP source code extracted to this directory, and
./configure
Make && make install
Then import the shell environment variable to the current directory
echo "Export path=/applications/mamp/bin/php/php{corresponding version}/bin: $PATH" >> ~/.profile
Run
. ~/.profile
Pear config-set php_ini/applications/mamp/bin/php/php{corresponding version}/conf/php.ini
PECL config-set php_ini/applications/mamp/bin/php/php{corresponding version}/conf/php.ini
Update pecl
Pecl channel-update pecl.php.net
Download and install VLD
wget http://pecl.php.net/get/vld-{corresponding version}.tgz
Tar zxvf vld-{corresponding version}.tgz
CD./vld-{corresponding version}
/applications/mamp/bin/php/php{corresponding version}/bin/phpize
./configure--with-php-config=/applications/mamp/bin/php/php{corresponding version}/bin--ENABLE-VLD
Make && make install
And then in
/applications/mamp/bin/php/php{corresponding version}/conf/php.ini add
[VLD]
Extension=vld.so
and modify php.ini in the Mamp option Edit Template
Then source ~/.profile
PHP runs after
php-dvld.active=1/path/to/your/code.php
We can see the output of the opcode.