Skip to content
Menu
  • Company
    • About Us
    • Store
    • Contact Us
  • E – Seva Kendra Common Service Center
  • Products And Services
  • Join our Social Network
  • Search
  • Company
    • About Us
    • Store
    • Contact Us
  • E – Seva Kendra Common Service Center
  • Products And Services
  • Join our Social Network

Instarr Softwares Ichalkaranji

Good sales people are first to be hired and last to be fired - Mr Shiv Khera

PHP Encoder

BENCODER v1.6 – Encode your PHP script using bcompiler

About bencoder

bencoder is a script to automate the encoding task using bcompiler.

bcompiler has the capability to encode entire script in a proprietary PHP application.

But the encoding task needs to be done manually, by calling the functions provided by bcompiler,
such as bcompiler_write_header(), bcompiler_write_file() and bcompiler_write_footer() functions.

bencoder can do these for you, it’s very similar to the encoder script provided by eAccelerator.

bencoder is an open source software. It applies GPL license.

Revision History

v1.6 – 2012/01/02 – improve error handling
v1.5 – 2011/12/06 – minor updates
v1.4 – 2010/04/01 – support bcompiler_set_filename_handler() for v0.9.2 (thanks Erwan Corvellec)
v1.3 – 2006/11/07 – support bzip2 compression (thanks to Paul Mandalka)
v1.2 – 2006/08/08 – support recursive mode
v1.1 – 2006/07/25 – first public release

Usage

bencoder [-f] [-q] [-t] -o FILE    file1.php
bencoder [-f] [-q] [-t] -o OUTDIR  file1.php file2.php ...
bencoder [-f] [-q] [-t] -o OUTDIR  -s SRCDIR  [-e SUFFIX] [-r] [-c] [-l]

  -o FILE   : the file name to write the encoded script
              (default to '-encoded.XXX' suffix)
  -o OUTDIR : the directory to write all encoded files

  -s SRCDIR
  -a SRCDIR : encode all files from this source directory

  -r        : encode directories recursively (no by default)
  -f        : force overwriting even if the target exists
  -t        : truncate/keep only the basename of the file into the bytecode
  -e SUFFIX : encode the files with the SUFFIX extension only (default: php)
              (regular expression allowed, ex: "php|inc")
  -c        : copy files those shouldn't be encoded (no by default)
  -l        : follow symbolic link (no by default)
  -q        : do not print the file name while encoding or copying
  -b
  -bz2      : compress the encoded files with bz2 (needs bzip2-extension)

Prerequisite

  1. Install bcompiler (the most updated version is 1.0.2)
    # pecl install channel://pecl.php.net/bcompiler-1.0.2
  2. Install PHP bzip2-extension if you need bz2 compression

Installation

  1. Download the script from http://bencoder.urdada.net/bencoder
    # wget http://bencoder.urdada.net/bencoder
  2. Turn on the execution permission bit on the script
    # chmod 755 bencoder
  3. Copy the script to /usr/local/bin/ or somewhere else in your PATH
    # cp bencoder /usr/local/bin/
  4. Run it and get an usage help
    # bencoder

Limitation

  • Bug #5693: value of __FILE__ is compiled into bytecode (Fixed at bcompiler 1.0.0)

Reference

  • PHP bytecode Compiler
  • Using bcompiler in FreeBSD (Chinese)

Author

Shen Cheng-Da
cdsheen at gmail.com

 

http://bencoder.urdada.net/

  • Web Development Course HTML | CSS | Javascript
  • Mysql Database Course
  • PHPmyadmin Course
  • PHP Coding Course
  • Image OCR to Text
  • Solutions to Problems
  • New Instarr Email yourname.instarr@gmail.com
  • Sign Up to Trello for your daily work assignments
  • Keep Open Whatsapp in PC
  • Install XAMPP to Linux
  • Create Gmail Email Templates for Marketing
  • PDF Tools
  • Files Shared instarrcom@gmail.com
  • Learning Center

Copyright © 2025 Instarr Softwares Ichalkaranji. All Rights Reserved.

Codilight Theme by FameThemes