Page 1 of 1

php opcodes

Posted: Tue Feb 05, 2008 7:20 pm
by Benjamin
Can someone give me some pretty specific instructions on how to view php opcodes for a page request? I'm not experienced with php internals.

Re: php opcodes

Posted: Tue Feb 05, 2008 8:18 pm
by Ambush Commander
Advanced PHP Programming by George Schlossnagle provides a pretty tutorial-ish overview on how to see opcodes. I believe the tool he used was op_dumper, which is developed here. You can also use Derick Rethan's tool.

Re: php opcodes

Posted: Tue Feb 05, 2008 8:24 pm
by Benjamin
Awesome I'll give those a shot.

Re: php opcodes

Posted: Tue Feb 05, 2008 8:33 pm
by Benjamin
hmmm

I followed the instructions:
t's not hard to use this extension, but it might not work with all PHP versions. Here are the instructions to get it to work:

1. Unpack the tarball: tar -xzf vld-0.8.0.tgz.
2. cd into the newly created directory.
3. Create the configure script: phpize
4. Now run "./configure" followed by "make install".

That's it, if you now run PHP from the command line and add the -dvld.active=1 parameter VLD will spit out the opcodes:

php -dvld.active=1 program.php
I su'd as root to install it, but when I execute a script, only the html is displayed. :?

Re: php opcodes

Posted: Tue Feb 05, 2008 8:42 pm
by Ambush Commander
Check the docs. Maybe it's meant to be run from the web-browser. I can't help you here; I've never used the script before :-)

Re: php opcodes

Posted: Tue Feb 05, 2008 8:57 pm
by Benjamin
Ok thanks. I don't think that will work because it's selective about what opcodes get printed out. I really need a way to do a full opcode dump like yesterday. Anyone got anything?