bcompiler php ubuntu
bcompiler php ubuntu
Setiap programmer pastilah ingin karya selalu dihargai minimal tidak untuk dibajak kode programnya. Hal itulah yang menjadi pemikiran saya dan tim untuk ‘mengacak’ kode program yang telah kita buat. Dari beberapa sumber dan coba sana sini bertemulah yang namanya bcompiler. Karena menggunakan linux khususnya ubuntu dan bahasa php, beberapa skenario kami siapkan. Setelah beberapa kali mencoba, akhirnya berhasil diterapkan dan sukses ‘mengacak’, sampai saya suka tersesat untuk mengembalikan kode program tersebut. Agar tidak lupa, akan saya tulis lagi urutan menerapkan bcompiler di linux ubuntu (saat mencoba ini, menggunakan Ubuntu Lucid). Yang terpenting koneksi internet jangan sampai terlewatkan dan untuk episode ini jauhkan dari kata GUI, kita mengarungi dunia hitam command prompt atau terminal dalam bahasa linux.
1. Instal dependen dari bcompiler terlebih dahulu :
root@yoyok-desktop:/# apt-get install automake m4 php5-dev php5-pear
2. Dan lanjutkan menginstal beberapa dependen lagi :
root@yoyok-desktop:/# apt-get install libbz2-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
libbz2-dev
0 upgraded, 1 newly installed, 0 to remove and 286 not upgraded.
Need to get 31.7kB of archives.
After this operation, 111kB of additional disk space will be used.
Get:1 http://dl2.foss-id.web.id/ubuntu/ lucid/main libbz2-dev 1.0.5-4 [31.7kB]
Fetched 31.7kB in 0s (121kB/s)
Selecting previously deselected package libbz2-dev.
(Reading database … 134004 files and directories currently installed.)
Unpacking libbz2-dev (from …/libbz2-dev_1.0.5-4_i386.deb) …
Setting up libbz2-dev (1.0.5-4) ..
3. Lakukan compile dan instal bcompiler dengan perintah berikut :
root@yoyok-desktop:/# pecl install channel://pecl.php.net/bcompiler-0.9.1
downloading bcompiler-0.9.1.tgz …
Starting to download bcompiler-0.9.1.tgz (47,335 bytes)
….done: 47,335 bytes
10 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
running: make
/bin/bash /var/tmp/pear-build-root/bcompiler-0.9.1/libtool –mode=compile cc -I. -I/tmp/pear/temp/bcompiler -DPHP_ATOM_INC -I/var/tmp/pear-build-root/bcompiler-0.9.1/include -I/var/tmp/pear-build-root/bcompiler-0.9.1/main -I/tmp/pear/temp/bcompiler -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/bcompiler/bcompiler.c -o bcompiler.lo
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
Build complete.
Don’t forget to run ‘make test’.
running: make INSTALL_ROOT=”/var/tmp/pear-build-root/install-bcompiler-0.9.1″ install
Installing shared extensions: /var/tmp/pear-build-root/install-bcompiler-0.9.1/usr/lib/php5/20090626+lfs/
running: find “/var/tmp/pear-build-root/install-bcompiler-0.9.1” | xargs ls -dils
Build process completed successfully
4. Jika terdapat pesan “ERROR: `phpize’ failed“, lakukan install pada php5-dev. Ulangi lagi dari depan untuk hasil yang optimal.
5. Tambahkan “extension=bcompiler.so” ke file /etc/php5/cli/php.ini dan /etc/php5/apache2/php.ini
6. wget http://bencoder.urdada.net/bencoder
7. chmod 755 bencoder
8. cp bencoder /usr/local/bin/
9. Berikut adalah beberapa perintah di bcompiler :
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
-a SRCDIR
-s SRCDIR : encode all files in 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)
Demikian susah bukan?, kalau sekali langsung sukses brarti menjadi rejeki anda. Kalau belum dicoba lagi sampai bisa.