Discuss this help topic in SecureBlackbox Forum

Installing and Using SecureBlackbox PHP edition

Before you start

SecureBlackbox PHP edition contains the DLL/.so library with all functionality, and a PHP extension module, used as a bridge between your PHP code and the .so library.

The PHP extension should be compiled for your particular PHP installation before it can be used. You will find the compilation instructions below.

The DLL/.so library is provided in pre-compiled form.

$INSTALL_PATH in below instructions is the path where secbboxphp_* archive has been unpacked.

Building with phpize utility (if you installed PHP as a binary)


Building on Linux and MacOS X

phpize or phpize5 utility is a part of php5-dev package, which is usually not installed by default. Please install this package, then proceed to below instructions.

Enter the "$INSTALL_PATH/ExtensionSources/sbb" folder and run the following commands:

		
phpize # or phpize5 depending on your OS and PHP version
./configure --with-sbb=$SECUREBLACKBOX_INSTALL_PATH/Libraries/$OS_VERSION
# SECUREBLACKBOX_INSTALL_PATH is the path where you have unpacked SecureBlackbox
# and OS_VERSION is the name of the subdirectory within Libraries directory,
# which matches your OS, eg. Linux32 for 32-bit Intel Linux
make
sudo make install
		
	

Building on Windows

Normally a pre-built extension could be found in the "$INSTALL_PATH\Extensions" subfolder. To compile the extension from sources, first Build your own PHP on Windows. Then execute the following commands in the PHP source folder:

		
buildconf.bat --force --add-modules-dir="$INSTALL_PATH\ExtensionSources"
configure.bat --disable-all --with-sbb=shared ...custom php build options...
nmake
		
	

Building with php on Linux and MacOS X (if you compiled PHP from source)

Copy contents of "$INSTALL_PATH/ExtensionSources" to php-src/ext directory.

Run the following commands from php source folder:

		
./buildconf --force
./configure --disable-all --with-sbb=$INSTALL_PATH/Libraries/All/$OS_VERSION ...custom php build options...
make
make test
make install
		
	

Using SecureBlackbox PHP extension

MacOS X

After successfully compiling SecureBlackbox extension you would need to install appropriate SecureBlackbox dynamic library from "$INSTALL_PATH/Libraries" directory.

To prevent build errors, in many cases it is a good idea to change the dynamic library's default installatio path using "otool" and "install_name_tool" Xcode commands.
To check current path to the library on, e.g., MacOS64, use the following terminal commands:

		
otool -L $INSTALL_PATH/Libraries/MacOS64/libsbbphp.dylib
		
	
the first entry of the output list contains the required information. Alternatively, to get only the path to the "libsbbphp.dylib":
		
otool -D $INSTALL_PATH/Libraries/MacOS64/libsbbphp.dylib libsbbphp.dylib
		
	
The following command will change this path to the desired value:
		
install_name_tool -id "<new_path>/libsbbphp.dylib" <current path>/libsbbphp.dylib"
		
	

Linux

After successfully compiling SecureBlackbox extension you would need to install appropriate SecureBlackbox dynamic library from "$INSTALL_PATH/Libraries" directory.

  1. To use the dynamic library under Unix systems, add "$INSTALL_PATH/Libraries/$OS_VERSION" line to the "LD_LIBRARY_PATH" environment variable or to the "/etc/ld.so.conf" configuration file. Alternatively, put the dynamic library to the default "/lib" or "/usr/lib" folder.
  2. Next, enable SecureBlackbox extension in "php.ini":
    			
    extension=sbb.so
    			
    		
  3. Finally, add the SecureBlackbox license key entry in "php.ini":
    			
    sbb.license_key=ABCD...
    			
    		

Windows

  1. Copy the appropriate SecureBlackbox extension from "$INSTALL_PATH\Extensions" (if not customly built) to the folder containing your PHP loadable extensions (modules).
    Copy the appropriate SecureBlackbox library from "$INSTALL_PATH\Libraries" to the directory where php.exe/httpd.exe reside, or add the corresponding extension's directory to the search path.

    For example:
    For PHP 5.5.x 64-bit Non Thread Safe (NTS) take the extension from "$INSTALL_PATH\Extensions\All\5.5\Release-NTS-x64" and the library from "$INSTALL_PATH\Libraries\All\Win64" folders.
    For PHP 5.6.x 32-bit Thread Safe (TS) take the extension from "$INSTALL_PATH\Extensions\All\5.6\Release-x86" and the library from "$INSTALL_PATH\Libraries\All\Win32" folders.

  2. Enable SecureBlackbox extension in "php.ini":
    				
    extension=php_sbb.dll
    				
    			
  3. Add the SecureBlackbox license key entry in "php.ini":
    				
    sbb.license_key=ABCD...
    				
    			
  4. Finally, restart the web server.
Note, that minimal supported PHP version is 5.3.9.

Discuss this help topic in SecureBlackbox Forum