@the_seppi answer is good and detailed and will probably do you, but I would like too add The quick way,using a terminal
sudo -i
apt-get install php5-dev build-essential
apt-get install php-pear
pecl download channel://pecl.php.net/blenc-1.1.4b
tar xzf blenc-1.1.4b.tgz
cd blenc-1.1.4b
phpize
Before you launch the configuration script you can change hardcoded key and expiration date in the blenc_protect.h file. Follow instruction in that file in order to edit information. Save changes and launch the configure script.
./configure
make
make install
Now you have to edit your /etc/php5/cli/php.ini configuration, adding at the end of file directives to load BLENC extension.
Warning This extension is EXPERIMENTAL. The behaviour of this extension including the names of its functions and any other documentation surrounding this extension may change without notice in a future release of PHP. This extension should be used at your own risk.
First, of course, you need PHP to be installed. I'll assume you already did this. Now, the guys from BLENC recommend not to use the easy method, so I'll skip that:
It's strongly recommended to install BLENC from sources without 'pecl' command. In this way you can:
Specify your personal encryption key used to create redistributable keys. Your sourcecode will be more difficult to decrypt also for users that can read your key_file on webserver.
Specify a expiration date for the BLENC module. With expiration date you can decide that BLENC module on target system will work until a date. After that BLENC will not decrypt any files.
All these configuration options are stored into header file: blenc_protect.h
Please read the content of blenc_protect.h in sources of BLENC to know how set these hardcoded options.
The 'hard way' (and recommended one) is to build the extension from source:
Install the php5-dev package: sudo apt-get install php5-dev
Extract the downloaded archive, open a terminal and cd into the directory with the extracted files
Run the following commands, as from this instruction. Before you do so, heed the recommendation from the authors and have a look at blenc_protect.h and do whatever it says in there, if you wish to do so.
phpize
./configure
make
sudo make install
The compiled module will automatically be moved to the correct directory. All left to do is to activate it by adding
extension=php_blenc.so
to your php.ini file. I think you'll notice in case the actual name is different. The default setup should now be concluded.
@the_seppi answer is good and detailed and will probably do you, but I would like too add The quick way,using a terminal
Before you launch the configuration script you can change hardcoded key and expiration date in the
blenc_protect.h
file. Follow instruction in that file in order to edit information. Save changes and launch the configure script.Now you have to edit your
/etc/php5/cli/php.ini
configuration, adding at the end of file directives to load BLENC extension.Here is my source with more details on further features
From http://php.net/manual/en/intro.blenc.php, just to have said it:
First, of course, you need PHP to be installed. I'll assume you already did this. Now, the guys from BLENC recommend not to use the easy method, so I'll skip that:
The 'hard way' (and recommended one) is to build the extension from source:
sudo apt-get install php5-dev
cd
into the directory with the extracted filesRun the following commands, as from this instruction. Before you do so, heed the recommendation from the authors and have a look at
blenc_protect.h
and do whatever it says in there, if you wish to do so.The compiled module will automatically be moved to the correct directory. All left to do is to activate it by adding
to your
php.ini
file. I think you'll notice in case the actual name is different. The default setup should now be concluded.