Mamp VLD configuration to view opcode example under OS X

Source: Internet
Author: User
Tags ini php file php source code


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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.