Installing BenCoder for PHP File Encoding Print

  • 12

BenCoder is a php script written to simplify the use of the bcompiler functions provided by the PHP development team. In order to use BCOMPILER, you will need to have a server that already has the packages installed, or the access to do so.

You can find BenCoder script here:

To install bcompiler, you will need to first install the following required packaged:

  • PHP 4.3 or higher
  • BZIP2
  • GCC (or a comperable C compiler)

You will also need access to install any dependancies that may be be required for your particular environment.

The official bcompiler website can be found here, with instructions for installation and function review:

The following instructions were found from the process of installation on a fresh server running Fedora v10 with Apache 2.x and PHP v5.x

  1. Make sure you're logged into a privilidged account (ie - root)

  2. Install the above mentioned required packages
    In Fedora - use the GNOME tool for Add/Remove
    Otherwise use apt-get, package manager, yum, or emerge depending on your system

  3. Download / Install bcompiler.
    > pear install bcompiler
    or check this URL for the latest file version ( and use
    > pecl install channel://
    This process should end with a Compilation / Build OK message. If not, read the output for errors and learn...

  4. Update your PHP.INI file to include the extension
    If you don't know where this file is...
    > cd /
    > find -name "php.ini"
    > vi /{path}/php.ini
    Find the Extensions section: [ESC] + ? + extension= + [ENTER]
    Add the line: [A] + + [ENTER]
    Save & Close: [ESC] + wq + [ENTER]

  5. Restart Apache
    > httpd -k restart

  6. Try Running BenCoder
    > php bencoder.php

    If you were successful, BenCoder should print some instructions for usage.

  7. Simple Test... Take some PHP files, put them into a folder called IN, then run this command:

    php bencoder.php -s IN -0 OUT -f -r -c -bz2

    -s =  Source Folder
    -o = Output Folder
    -f = Overwrite Existing
    -r = Run Recursively
    -c = Copy files not processed (ie - non-php files)
    -bz2 = Compress Encoded Files with BZip2

    You should receive output indicating the encoding was completed.

Congrats! You are one of a few that can now compile your own code.
Now if someone can just come up with a seeding token system for code authentication we might have somethin'

bCompiler as an Encryption Solution: BCompiler (as expressed by the PHP team) was developed to provide a bytecode compiler transport that will allow PHP to be used in a larger arena (ie - breaking into desktop applications), for improved performance by eliminating run-time compiles, and to provide a solution to the growing concerns with code obfuscation. While products like Zend and IonCube offer encryption atop the bytecode transport, the use of compiled code makes the task of reverse-engineering software extremely challenging. THERE ARE NO KNOWN METHODS for encrypting ANY software that a smart enough coder with enough determination wouldn't eventually decompile. HOWEVER, PHP in native source format, even when obfuscated with these silly variable renaming operations, is much easier to decipher than the recomposition of source code from binary.

Was this answer helpful?

« Back