php opcodes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

php opcodes

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Re: php opcodes

Post 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.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: php opcodes

Post by Benjamin »

Awesome I'll give those a shot.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: php opcodes

Post 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. :?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Re: php opcodes

Post 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 :-)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: php opcodes

Post 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?
Post Reply