Discuss this help topic in SecureBlackbox Forum

Installing and Using SecureBlackbox PHP edition

Building SecureBlackbox PHP extension

Building with php on Linux and MacOS X

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
		
	

Building with phpize utility on Linux and MacOS X

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

		
phpize
./configure --with-sbb=$INSTALL_PATH/Libraries/All/$OS_VERSION
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
		
	

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/All/$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.
$INSTALL_PATH is the path where secbboxphp_win.zip archive was unpacked.

Discuss this help topic in SecureBlackbox Forum